ADO/ODBC call via Python/IIS

Bill Seitz bseitz at my-deja.com
Wed Feb 7 17:53:45 EST 2001


Did some more research. Changed a line of code to look like
adoConn = win32com.client.Dispatch('ADODB.Connection')
adoConn.Open('SQL Server;server=sql0;uid=xxx;pwd=yyy;database=zzz')

Get similar error message:
Error Type:
Python ActiveX Scripting Engine (0x80020009)
Traceback (innermost last): File "<Script Block >", line 3, in ? x =
aAdoDsn.aConnect() File "c:\python20\ipath\aAdoDsn.py", line 8, in
__init__ adoConn.Open('SQL
Server;server=sql0;uid=xxx;pwd=yyy;database=zzz') File "c:\python20
\win32com\gen_py\00000206-0000-0010-8000-00AA006D2EA4x0x2x6.py", line
1833, in Open return self._ApplyTypes_(0xa, 1, (24, 32), ((8, 49), (8,
49), (8, 49), (3, 49)), 'Open', None,ConnectionString, UserID,
Password, Options) File "c:\python20\win32com\client\__init__.py", line
334, in _ApplyTypes_ return self._get_good_object_(apply
(self._oleobj_.InvokeTypes, (dispid, 0, wFlags, retType, argTypes) +
args), user, resultCLSID) COM Error: [Microsoft][ODBC Driver Manager]
Data source name not found and no default driver specified

What am I doing wrong?


In article <95sisd$ahc$1 at nnrp1.deja.com>,
  Bill Seitz <fluxent at yahoo.com> wrote:
> Well, it's a User DSN. Do you know that ASP expects a system DSN?
>
> And, I'm not clear on what a DSN-less connection is. Does this mean
> that I don't set up an ODBC source at all, but just pass all the
> connection details along in a code call? If so, do I need to use a
> different COM object (see my original posting for code), or just call
> the same object with a bigger set of params? (Sorry, I'm new at this,
> probably need some additional books of examples...)
>
> In article <%FGe6.31314$Ch.7369562 at newsrump.sjc.telocity.net>,
>   "dsavitsk" <dsavitsk at e-coli.net> wrote:
> > > >         adoConn.Open('pyasp')
> >
> > > Is it possobile pyasp is a user DSN, when ASP expects systems
DSNs?
> >
> > if this is the issue, asp and python work well (faster in fact on a
> web
> > server) with dsn-less connection strings.
> >
> > ds
> >
> >


Sent via Deja.com
http://www.deja.com/



More information about the Python-list mailing list