Dardo:<br>
  Why are you going to all this work?<br>
<br>
You could simply...<br>
import adodbapi<br>
which has all of the COM interface things already written.<br>
<br>
There is a new version which has the ability to access columns by name, 
and which uses objects to read data directly from the recordset (rather 
than copying data into Python tuples.)  You can pick it up from <a href="http://sourceforge.net/projects/adodbapi/">http://sourceforge.net/projects/adodbapi/</a> -- that installer will replace the copy which comes with pywin32.<br>


<br>
It passes all of the tests (including reading and writing ACCESS tables)
 -- but someone trying the new features in a new application would be 
very welcome.  Unit tests can miss things.  Please try it out and let me
 (and everyone else) know how it works for you.<br>
--<br>
Vernon Cole<br><br><div class="gmail_quote">On Thu, Sep 2, 2010 at 4:36 AM, Dardo Schuster Glez <span dir="ltr">&lt;<a href="mailto:dardoschuster@hotmail.com">dardoschuster@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">





<div>



Dear Sirs<br> <br>I was programming many years with delphi/sql server and now i am looking python with your ado library to migrate . I am making my first ado program with python using python 3.1 and pythonwin but i have a problem : recordset canīt acces fields data i send you a sample and the answer from python <br>

 <br># First import two useful modules<br>import win32com.client<br>from adoconstants import *<br># Create the ADO Connection object via COM.<br>oConn = win32com.client.Dispatch(&#39;ADODB.Connection&#39;)<br># Now set the connection properties via the ConnectionString<br>

# We&#39;re connecting to a SQL Server on 192.168.1.100 using OLEDB.<br>oConn.ConnectionString = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\personal.mdb;&quot; <br># Now open the connection<br>oConn.Open()<br>
  <br>
if oConn.State == adStateOpen:<br>  # Do something here<br>  print (&quot;We&#39;ve connected to the database.&quot;)<br># Now create a RecordSet object and open a table<br>  rs = win32com.client.Dispatch(&#39;ADODB.Recordset&#39;)<br>

  rs.Open(&quot;select * from agenda&quot;,oConn,1,3)             # Open a table called agenda<br>  # Can also use oRS.Open(&quot;zipcode&quot;, oConn) instead of setting ActiveConnection<br>  print( repr(rs))<br>  <br>  while not rs.EOF:<br>

      print (rs.fields(&quot;nombre&quot;))    <br>      # Move to the next record in the RecordSet<br>      rs.MoveNext()<br>  <br># Close up the connection and unload the COM object<br>  if oConn.State == adStateOpen: oConn.Close()<br>

  oConn = None    <br><br> <br>Answer from python <br> <br>We&#39;ve connected to the database.<br>&lt;win32com.gen_py.Microsoft ActiveX Data Objects 2.8 Library._Recordset instance at 0x26371984&gt;<br>Traceback (most recent call last):<br>

  File &quot;C:\Dardo\Lenguaje Python\ado\Ejemplo\base-de-datos.py&quot;, line 27, in &lt;module&gt;<br>    print (rs.fields(&quot;nombre&quot;))<br>  File &quot;C:\Python31\lib\site-packages\win32com\client\__init__.py&quot;, line 462, in __getattr__<br>

    raise AttributeError(&quot;&#39;%s&#39; object has no attribute &#39;%s&#39;&quot; % (repr(self), attr))<br>AttributeError: &#39;&lt;win32com.gen_py.Microsoft ActiveX Data Objects 2.8 Library._Recordset instance at 0x26371984&gt;&#39; object has no attribute &#39;fields&#39;<br>

 <br>Which is the problem ???<br>Please answer a soon as posible<br>Thanks<br>Dardo R. Schuster<br>Tenerife - canary islands - Spain<br> <br> <br><br>                                               </div>
<br>_______________________________________________<br>
python-win32 mailing list<br>
<a href="mailto:python-win32@python.org">python-win32@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-win32" target="_blank">http://mail.python.org/mailman/listinfo/python-win32</a><br>
<br></blockquote></div><br>