Non-ODBC MS Sql Connect

Roberts, Robert J robert_j_roberts at rl.gov
Fri Jul 23 14:29:08 EDT 1999


Thanks for the quick reply.

I tried it, however, and get:

  File "C:\Web\http\isearch\testNonOdbc01.py", line 44, in Main
    import win32com.client
  File "C:\Program Files\Python\win32com\client\__init__.py", line 8, in ?
    import dynamic, CLSIDToClass, gencache, pythoncom
  File "C:\Program Files\Python\win32com\client\dynamic.py", line 22, in ?
    import pythoncom
ImportError: No module named pythoncom

I have pythoncom documentation in: c:\python\win32com\html

...but no pythoncom.py

I re-downloaded the latest win32all and reinstalled, but still no
pythoncom.py.

Am I being brain dead or am I missing something?

Bill Tutt wrote:

> You can always use ADO from Python on NT.
>
> Quick example:
> import win32com.client
> import win32com.client.makepy
> import win32com.client.genpy
> import win32com.client.gencache
> adolib = win32com.client.gencache.EnsureModule(
>         '{00000200-0000-0010-8000-00AA006D2EA4}', # TypeLib GUID for ADO
>         win32con.LANG_NEUTRAL, # LCID
>         2, # Major version #
>         0, # Minor version #
>         win32com.client.genpy.GeneratorProgress()) # Silent progress
> indicator.
> # ALL loaded typelibrary constants...
> k = win32com.client.constants
> cxnSQLServer = adolib.Connection()
> cxnSQLServer.CursorLocation = k.adUseNone
> cxnSQLServer.Provider = "SQLOLEDB"
> cxnSQLServer.Open("Server=MachineName;Database=master;UID=user;PWD=apple")
>
> rs = adolib.Recordset()
> rs.Open("select * from sysobjects", cxnSQLServer, k.adOpenForwardOnly,
>         k.adLockReadOnly)
> # etc.....
>
> Bill
>
> > -----Original Message-----
> > From: Roberts, Robert J [mailto:robert_j_roberts at rl.gov]
> > Sent: Thursday, July 22, 1999 5:33 PM
> > To: python-list at cwi.nl
> > Subject: Non-ODBC MS Sql Connect
> >
> >
> > How to do I make a non-odbc connection to a MS SQL Server?
> >
> > Am running Python Windows NT/IIS.
> >
> > Thanks,
> >
> >





More information about the Python-list mailing list