How to use makepy?

Dag Sunde dag at orion.no
Sun Jul 9 20:21:55 EDT 2000


It got 2 from the implicit "self" parameter
that all classes in python is called with...

So what effectively is sendt in your call is:
     print DBRec(self, 0).Value

But what puzzles me is that your code is running for
me... (With ths AddrBook.mdb sample-database)...

Dag.


"Dale Strickland-Clark" <dale at out-think.NOSPAM.co.uk> wrote in message
news:8ka7cd$c3$1 at supernews.com...
> 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