[Tutor] (no subject)

bimal shah bimal291@hotmail.com
Wed, 22 Nov 2000 10:31:20 -0000

Hi actually i was executing the follwing code:

# \user\local\bin\python

import dbi, odbc     # ODBC modules

        s = odbc.odbc('bimal/bimal/bimal')

# i have given SYSTEM DSN= "bimal"
# and also during advanced setting of DSN
# login="bimal" and password="bimal"

        cur = s.cursor()
        cur.execute('select * from bimal1')

#bimal1 is my table from database="bimal"
#i had set the path of system database "bimal" during setting of system #DSN
        print cur.description
        for tup in cur.description:
                print tup[0],
        while 1:
                rec = cur.fetchmany(10)
                if not rec: break
                print rec
except NameError,e:
        print 'error ', e, 'undefined'

#  I put my .py file in d:/python20/win32/ where dbi.dll and odbc.pyd #is 

After executing files i am getting following traceback:

Traceback (most recent call last):
File "d:\python20\pythonwin\pywin\framework\scriptutils.py", line 301, in 
    exec codeObject in __main__.__dict__
  File "D:\Python20\win32\python fiels\dbtest.py", line 10, in ?
    s = odbc.odbc('bimal/bimal/bimal')
dbi.operation-error: [Microsoft][ODBC Microsoft Access Driver]General error 
Not enough information to connect to this DSN with SQLConnect.   Use 
SQLDriverConnect. in LOGIN

          i am feeling that some thing problem is with importing module.
so  please direct me for solving my problem.

Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com