[Tutor] Threads.... Unhandle my Exception you Feind!
Daniel Yoo
dyoo@hkn.eecs.berkeley.edu
Wed, 13 Jun 2001 16:09:49 -0700 (PDT)
On Wed, 13 Jun 2001 kromag@nsacom.net wrote:
> > Let's look at the rest of the program:
> >
> > > import string
> > > import thread
> > >
> > > engine=win32com.client.Dispatch("DAO.DBEngine.35")
> > > db=engine.OpenDatabase("windowsdesktopterror.mdb")
> >
> > Ok, I'm not imagining things after all. *grin* There are backslashes on
> > this line: can you double check?
>
> But, but, but..... Really! I am looking at the code I pasted in! It has
> double backslashes! What manner of madness? Surely your mail agent doesn't
> parse them into links? Anyway, I tried it with the r"pathtofile" method
> and got the same error:
Strange! Now I'm really confused. I'm using Pine as my email program,
which I don't think does any email preprocessing. My apologies for my
earlier message; I didn't realize the messages were being mangled. Sorry
about the confusion there. What kind of email program are you using?
> >pythonw -u dbwrong.py
> Unhandled exception in thread:
> Traceback (most recent call last):
> File "dbwrong.py", line 15, in write
> db.Execute("insert into data values(%f, '%s')" % inputtage)
> AttributeError: 'None' object has no attribute 'Execute'
> >Exit code: 0
The assumption I'm working on is that 'db' itself is None. If you could
add the line:
###
if db == none:
print "We didn't get the database connection yet."
###
right before the Execute, that will help test this guess. I'm focusing on
the engine.OpenDatabase() call earlier, because that's where 'db' is being
initialized.
> Ah well. I am going to not think about it for a week. That has
> traditionally been the length of time it takes for the answer to
> coalesce out of the aether! :-)
Don't worry about it. My head is starting to spin too... *grin* Again,
sorry about the bad advice earlier. I have to learn to be more careful
when I'm reading messages.
You may want to talk with the people on the db-sig a bit more; it sounds
like they have good experience with the Jet database stuff. Good luck to
you!