ODBC Problem on IIS4

Gordon McMillan gmcm at hypernet.com
Fri Dec 10 09:47:32 EST 1999


Jack Knight writes:

> I am getting the following error when trying to do a simple SQL
> lookup:

>          cursor.execute(query,params)
>      dbi.internal-error: [Microsoft][ODBC Microsoft Access 97
>      Driver] Invalid argument. in EXEC
> 
> Setup is:
> Windows NT4 SP5, IIS4, ODBC V3.5. Python 1.5.
> 
> Offending Code fragment:
> 
> def login(id,password):
>  realPwd=decrypt(password)
>  # Perform the query to the database
>  connection=odbc.odbc(cfg.DSN)
>  cursor=connection.cursor()
>  params=[id,realPwd]
>  query="select CustomerID, Password, Status from CustomerDetails
>  where
> CustomerID=:1 and Password=:2"
>  cursor.execute(query,params)
>  row=cursor.fetchone()

IIRC, the Access driver wants "...CustomerID=? and 
Password=?". 

- Gordon




More information about the Python-list mailing list