DB API for ADO/DAO?

Bjorn Pettersen BPettersen at NAREX.com
Wed Apr 16 02:22:46 EDT 2003


> 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\0 DATABASE=DbName\0 TRUSTED_CONNECTION=YES\0
SERVER=ServerName\0\0 ");

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>.

-- bjorn





More information about the Python-list mailing list