How to use makepy?

Dale Strickland-Clark dale at out-think.NOSPAM.co.uk
Sun Jul 9 11:55:52 EDT 2000


Thanks for all replies. I've now read the chapter in Python Programming on
Win32 and am somewhat the wiser.

However, I am confused as to why it seems to break this very simple program
after running Makepy on "Microsoft ActiveX Data Objects 2.5 Library".

At the print statemtent, I get this:

    print DBRec(0).Value
TypeError: too many arguments; expected 1, got 2

Where did it get 2 from?

------------------------
import win32com.client

DBCon = win32com.client.Dispatch("ADODB.Connection")
DBRec = win32com.client.Dispatch("ADODB.Recordset")
DBRec.CursorLocation = 3  # adUseClient = 3

sDB = "s:\\ths\\merlin.mdb"

DBCon.Open("Driver={Microsoft Access Driver (*.MDB)}; DBQ=" + sDB)
#DBRec.open("House", DBCon, adOpenStatic, adLockOptimistic, adCmdTable)
DBRec.Open("House", DBCon, 3, 3, 2)

DBRec.AddNew()
DBRec.Fields("Price").Value = 234000
DBRec.Update()
print DBRec(0).Value

DBRec = None
DBCon = None
----------------------------

Thanks for any help

Dale Strickland-Clark


"Roger Upole" <rupole at compaq.net> wrote in message
news:4p%95.10247$A06.1298430 at pouncer.easynews.com...
> It should speed up your COM calls.  Also, you can browse thru the
> generated file and see all the properties and methods of the COM
> object.
> Once the object has been created, the constants will be available as
> win32com.client.constants.someconstantname.
> There is a Readme.html in the /win32com directory, and more documentation
in
>   /win32com/HTML/QuickStartClientCom.html.
>              HTH
>                  Roger Upole
>
> "News.tele2.co.uk" <dale at out-think.NOSPAM.co.uk> wrote in message
> news:8k9o91$7b1$1 at supernews.com...
> > Well I've run it and it seemed to work but I'm not really sure what to
do
> > next.
> >
> > In fact, I'm not entirely sure what it's supposed to do for me but I'm
> > hoping it will at least give me access to some COM object constants.
> >
> > Where is it documented?
> >
> > Thanks
> >
> > Dale Strickland-Clark
> >
> >
> >
> >
>
>





More information about the Python-list mailing list