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

M.-A. Lemburg mal at lemburg.com
Mon Jan 24 11:11:22 EST 2000


Peter Larbalestier wrote:
> 
> G'day All,
> 
> A number of queries:
> 
> 1. Windows connection via ODBC to a SQL mdb on NT Server 4.0
>     I have been making a connection to our SQL7.0 mdb via ODBC after
> having set up a 'DSN' in the 'ODBC Data Source Administrator' window..
> Most of the examples I have viewed so far refer to this practice.
>     i.e. >>>import odbc, dbi
>           >>>mydb = odbc.odbc(dsn,uid,pwd)
> 
> It worries me though that this seems to create a "permanent" connection
> to the database as there is an open port listening for any queries.
> 
> Does anyone have any sample code for connecting on the fly to a SQL7.0
> mdb WITHOUT using the 'ODBC Data Source Administrator' to setup a
> "permanent" DSN.
> 
> Having programmed in VB I simplly conect on the fly using ADO to our
> SQ7.0 mdb. Can this be done with Python using mxODBC?
>     I believe so ! but can anyone help me with an example?

Not an example, but you can use the mxODBC ODBC.Windows.DriverConnect()
API to create a connection using all the options you need to specify
for the DSN... perhaps there is a way to tell the ODBC manager
to create a DSN on the fly simply by providing the file name ?!
 
> 2. UNIX connectivity to SQL7.0 mdb on NT Server 4.0
>     It seems that using ODBC - ODBC Bridge is the way to go but this is
> after the NT problem.

You can do this in these ways:

1. Use one of the OpenLink or Merant (InterSolv) multi-tier
   driver sets

2. Use a ODBC-bridge such as the one sold by EasySoft

3. Write a Python server for your app which runs on NT and
   serves a client on the Unix machine (not as hard as you might
   expect -- see SocketServer.py).
 
> I hope that this forum will provide some definitive answers for all us
> 'newbies' in regards to these important issues.

Me too ;-)

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/






More information about the Python-list mailing list