[Zope] - Zope/ODBC and MS Sql Server 6.5 connection

Kiss, Arpad AKiss@GEOMETRIA.hu
Wed, 6 Jan 1999 10:04:17 +0100


Hi!
I couldn't connect to Sql Server 6.5 too. I  looked at db.py (line
160-164 contains the important things) and ODBC log  file and I found
that:
*	 the Zope uses SQLConnect function. It has three parameters: DSN, UID
and AuthStr
*	db.py uses string.split(connect string), so we have to type in the
connect string: dsn userid password. I tested it with Oracle and Access
ODBC driver and it works.
*	but it doesn't work with SQL Server 6.5 driver, because in this case
SQLConnect returns SQL_SUCCESS_WITH_INFO (=1) instead of SQL_SUCCESS(=0)
and I suppose Zope handles it as it returns SQL_ERROR(=-1).

I have found this in the SQL Server 6.5 driver help:

SQLConnect retrieves the value of the LANGUAGE keyword from the ODBC
data source definition. If the SQL Server driver is unable to use the
specified language, it uses the default language for the specified user
ID, and SQLConnect returns SQL_SUCCESS_WITH_INFO. If SQL Server is
unable to use the default language for the specified user ID, SQLConnect
returns SQL_ERROR.
SQLConnect retrieves the value of the DATABASE keyword from the ODBC
data source definition. If the SQL Server driver is unable to use the
specified database, it uses the default database for the specified user
ID, and SQLConnect returns SQL_SUCCESS_WITH_INFO. If SQL Server is
unable to use the default database for the specified user ID, SQLConnect
returns SQL_ERROR.

In the ODBC data source definition I set the LANGUAGE and DATABASE to
the defaults of the specified user ID but it couldn't help.
Perhaps there is someone out who can help us based on the above pice of
information.
Thanks in advanvce:
¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
Kiss Árpád
akiss@geometria.hu
¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤