ADO example code failed:hlp!

Hoon Yoon hyoon at bigfoot.com
Thu Aug 5 22:26:14 CEST 1999


Running Christian's code, I get following error message. What am I doing
wrong? It's same code, but the constants do not contain adModeReadWrite.
Pls help!
Thanks much in Adv,

import win32com.client
db=win32com.client.Dispatch("ADODB.Connection")
from win32com.client import constants
db.Mode = constants.adModeReadWrite
db.Open("Access DB")
db.Execute("create table mist (name varchar, wert long)")
rs=win32com.client.Dispatch("ADODB.Recordset")
rs.Open("mist", db, constants.adOpenDynamic, -1, constants.adCmdTable )
rs.AddNew()
rs.Fields("name").Value="hugo"
rs.Fields("wert").Value=123.45
rs.Update()

Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> ## working on region in file c:\tmp\python-aDA-KJ...
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "c:\tmp\python-aDA-KJ", line 4, in ?
    db.Mode = constants.adModeReadWrite
  File "C:\Python\win32com\client\__init__.py", line 72, in __getattr__
    raise AttributeError, a
AttributeError: adModeReadWrite
>>> 
-- 
*****************************************************************************
S. Hoon Yoon (Quant) Merrill Lynch Equity Trading, 
yelled at yahoo.com hoon at bigfoot.com(w)
"Miracle is always only few standard deviations away, but so is
catastrophe."
* Expressed opinions are often my own, but NOT my employer's.
"I feel like a fugitive from the law of averages."    Mauldin
*****************************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vcard.vcf
Type: text/x-vcard
Size: 202 bytes
Desc: Card for Hoon Yoon
URL: <http://mail.python.org/pipermail/python-list/attachments/19990805/c79a9fba/attachment.vcf>


More information about the Python-list mailing list