Re: conecting with a MsAcces DB by dao
- From: "luis" <solisgb@xxxxxxxxx>
- Date: 30 Jun 2006 05:39:23 -0700
Iain King ha escrito:
luis wrote:
Iain King ha escrito:
luis wrote:Yes, is inside
while not rs.EOF:
id=rs.Fields(colName.Value) #colName, valid column name
...
rs.MoveNext()
rs.Close()
conn.Close()
I don't know if it's the problem your asking about, but your
rs.MoveNext() should be inside the while loop, no?
You mean, it is inside the while loop in your code, but you made a
mistake copying it into your post? In the code you posted it is not
inside the while loop - it would have to be indented one more level for
that.
Iain
this is te correct identation
def append_from_Access(self):
try:
import ...
conn = win32com.client.Dispatch(r'ADODB.Connection')
DSN = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
SOURCE=C:/Afile.mdb;"
conn.Open(DSN)
except Exception, inst:
...
try:
sql_statement='SELECT * FROM Mytable'
rs = win32com.client.Dispatch(r'ADODB.Recordset')
rs.Open(sql_statement, conn, 1, 3)
while not rs.EOF:
id=rs.Fields(colName.Value) #colName, valid column name
...
rs.MoveNext()
rs.Close()
conn.Close()
except Exception, inst:
...
I think my problem must be with ado and dao.
Now I have run makepy utility and select Microsoft ActiveX Data Objects
2.5 Library, perhaps I must also select Microsoft DAO3.5 Object Library
and write
win32com.client.Dispatch("DAO.DBEngine.35") for Access 97 or
win32com.client.Dispatch(r'ADODB.Connection') for Acess 2000
Do you know is it possible ?
luis
.
- Follow-Ups:
- Re: conecting with a MsAcces DB by dao
- From: Iain King
- Re: conecting with a MsAcces DB by dao
- References:
- conecting with a MsAcces DB by dao
- From: luis
- Re: conecting with a MsAcces DB by dao
- From: Iain King
- Re: conecting with a MsAcces DB by dao
- From: luis
- Re: conecting with a MsAcces DB by dao
- From: Iain King
- conecting with a MsAcces DB by dao
- Prev by Date: Re: list comprehension
- Next by Date: finding the last file created in a directory
- Previous by thread: Re: conecting with a MsAcces DB by dao
- Next by thread: Re: conecting with a MsAcces DB by dao
- Index(es):