When you add an ODBC connection to Sybase 11x and the catalog name is specified in the connection string for the Microsoft OLE DB Provider for ODBC Drivers, this error occurs:
This problem occurs because of a bug in the Merant Sybase ODBC driver. The system stops responding if
SQL_
ATTR_
CURRENT_
CATALOG is set on the connection handle before the actual connection is made with SQLDriverConnect.
This problem can be prevented if the initial catalog is not specified when you connect to Sybase 11.x with the Microsoft OLE DB Provider for ODBC Drivers (MSDASQL) and the Sybase ODBC driver.
Microsoft has determined that this problem occurs due to a bug in the Merant Sybase ODBC driver. The MSDASQL provider has no role in this process.
When you use the Merant Sybase ODBC driver in conjunction with MSDASQL to set up a connection, if you specify a Catalog name, this error occurs:
If the catalog name is specified,
SQL_
CURRENT_
QUALIFIER is set on the connection handle before the connection occurs, which then causes an Access Violation in the Syutlnt.dll file.
To reproduce the problem, use Visual Studio 6.1 service pack 3 (SP3), with the Viddbpkg.dll file that enables the data source link (DSL), and follow these steps:
- Use Visual Studio and create a Web project.
- In the Project Explorer window, highlight the project
name, right-click the project name and then click Add Data Connection.
- In the Data Sources dialog box, click the Machine Data Sources tab and select Microsoft OLEDB for ODBC Drivers.
- In the Data Link Properties dialog box, choose Next.
- Select ODBC System DSN to Sybase.
- Enter a Login.
- Enter a Catalog.
- Click OK.
If the user selects an initial catalog in the DSL, the DSL returns a connect string that looks like this:
"Provider=MSDASQL.1;
Persist Security Info=False;
User ID=sa;
Data Source=MySystemSyBase;
Initial Catalog=pubs2"
Opening a Microsoft ActiveX Data Objects (ADO) connection against a SYBASE database with this connect string fails. The MSDASQL provider normally translates Initial Catalog to Database but apparently the Sybase driver does not accept that keyword.