odbc difficulties 
Author Message
 odbc difficulties

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



Sat, 22 Apr 2000 03:00:00 GMT  
 odbc difficulties

Umm.. there is no environment() method in the ODBC module...
Are you trying to get at the shell environment variables?
You can get those from "os.environ".

You need to import dbi before odbc because it makes things much simpler for
the Win32 dynamic loader.

Bill Tutt
Not speaking for Microsoft, etc...

Quote:
> -----Original Message-----

> Sent:      Tuesday, November 04, 1997 10:57 AM

> Subject:   odbc difficulties

> 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



Sat, 22 Apr 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Migrating to ODBC. (Convirtiendo a ODBC)

2. Access odbc driver in ODBC 3.0

3. Configure ODBC Data Source WITHOUT Using ODBC Administrator

4. Connect to TSM ODBC Driver with Regina and Rexx/SQL for ODBC no longer possible

5. Bugs corrected in DBD/ODBC/ODBC.rb and DBD/Proxy/Proxy.rb

6. ODBC connectivity to SQL7.0 mdb, UNIX - ODBC Bridges

7. $: (self-reference) difficulties

8. Difficulties creating an External Library Class

9. some icon difficulty

10. ElastoLab promotion difficulties

11. Simple difficulty

12. Difficulty in using Visual Wave Server

 

 
Powered by phpBB® Forum Software