ADODB.RecordSet bummer ( was Re: Python and DB support (was: Re: Is Python Dead?))

Bill Bell bill-bell at bill-bell.hamilton.on.ca
Tue Jul 3 17:57:44 EDT 2001


[Martelli's address not included since many list members may 
already know it.]

Alex Martelli wrote, in part:

> you CAN write rs.Fields("FieldName").Value ... [and] ... I believe
> ADO (and much more so, COM:-) deserves a far better language than
> Visual Basic... Python, for example!-). 

Yup, me too FWIW. So, as one of this list's most longstanding 
newbies, I decided to give the combination a spin.

In VBA it's common to coin the cliche:

with myRecordSet
	.edit
	.fields('myField') = 42
	.update
end with

Unfortunately,

>>> import win32com.client
>>> rs = win32com.client.Dispatch("ADODB.RecordSet")
>>> rs.ActiveConnection = "DSN=WebPASS"
>>> rs.Open("[URLs]")
>>> rs.Fields("myField") = 42
Traceback (SyntaxError: can't assign to function call

Or, is this because I forgot my medication this morning?

Bill

Bill Bell, Software Developer




More information about the Python-list mailing list