problem accessing Access
hsmyers at sdragons.com
hsmyers at sdragons.com
Sun Dec 26 16:37:56 EST 1999
With the following I get:
>>> from win32com.client.dynamic import Dispatch
>>> dbEngine = Dispatch('DAO.DBEngine')
>>> db = dbEngine.OpenDatabase('c:/my documents/eco.mdb')
>>> rs = db.OpenRecordset('ECO')
>>> rs.Index = 'FEN'
Traceback (innermost last):
File "<interactive input>", line 1, in ?
File "C:\Program Files\Python\win32com\client\dynamic.py", line 439,
in __setattr__
raise AttributeError, "Property '%s.%s' can not be set." %
(self._username_, attr)
AttributeError: Property '<unknown>.Index' can not be set.
>>>
The equivalent code in VB:
Set db = Workspaces(0).OpenDatabase("C:\My Documents\eco")
Set rsECO = db.OpenRecordset("ECO", dbOpenTable)
rsECO.Index = "FEN"
works just fine...
All of which suggests that I'm doing something wrong---but I've no clue
as to what?
hsm
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list