All
Recently I started useing the odbc interface within the python shell. It
works great for what I need it to do by
the way!!! HOWEVER I would like to run a few ODBC scripts from a system
call from WINNT .. to no avail.
First I got that the script couldn't locate the DBI.dll file .. so I
copied it into my user path. Then I placed the
statement import dbi .. for no reason other than I read it was a good
thing to do. I am now fairly stuck on
an attribute error for the e=odbc.environment(). Yet this thing works
very well if in the Python shell if I
pull the old "from isqlit import *" trick .. here is a transcript of my
system call:
C:\>python C:\QA\bin\isqlit.py
DSN=SAMPLEDB;DBQ=C:\Test1.mdb
Traceback (innermost last):
File "C:\QA\bin\isqlit.py", line 15, in ?
e = odbc.environment()
AttributeError: environment
here is a paired down version of my script:
import dbi
import odbc
import odbc_installer
import tputils1
import os
import regex
import regsub
import string
i.config_data_source (i.ODBC_ADD_DSN, 'Microsoft Access Driver (*.mdb)',
'DSN=TEST1;DBQ=C:\\TEST1.MDB;')
# here is the EVIL statement BURN IT!!!
e = odbc.environment()
c.connect ('TEST1')
P_list = c.query('select * from PART')
print P_list
raw_input("stop")
Any suggestions or ideas .. this is actually fairly important to me at
this point in time.
Sincerely
QA Engineer at Thru-Put Technologies
extension 846