DB API for ADO/DAO?

John Burton john.burton at jbmail.com
Wed Apr 16 06:17:45 EDT 2003


Bjorn Pettersen wrote:

> > From: Jimmy Retzlaff [mailto:jimmy at retzlaff.com] 
> > 
> > Steve Holden (sholden at holdenweb.com) wrote:
> > > "John Burton" <john.burton at jbmail.com> wrote in message
> > ...
> > >> The problem with odbc is that you need to manually set up data
> > >> sources using the control panel which isn't something I want 
> > >> the users to have to do.

> Agreed, but you don't have to even in ODBC :-) I'm assuming that what
> you're really looking for is a way to call:

>   hr = SQLConfigDataSource(
>          NULL,
>          ODBC_ADD_SYS_DSN, 
>          LPCTSTR(driverDescription), // I believe for display purposes
> only
> 	   "DSN=foo DATABASE=DbName TRUSTED_CONNECTION=YES
> SERVER=ServerName ");

> which will create a new system data-source called "foo". I don't
> remember seeing it exposed in either odbc or mxODBC, and it's too late
> for me to remember all (not to mention the best) way to call a random C
> function from Python, so I'm leaving that as an excercise for the reader
> <wink>.


I didn't know you could do that. It shouldn't be too hard for me to code
up a little c extension to do this if all else fails.

And thanks for all the other replies here and in email. Some useful
information there.





More information about the Python-list mailing list