on 2012 Dec 13 6:36 AM
Hello, I have a old myDemo.db file, that was created from Sybase 5.0. I need to create a Windows app to access that DB, I have tried all possibles connections strings (using ODBC), but none worked.
I have installed the Sybase 5.0 server and client app, I created the server locally(by service manager) and I can access by ISQL, but when I try to access from a .net windows app, doesn't work.
Recently, I installed the Sybase latest version, but when I try to create the myDemo.db, using the Personal Server app, doesn't work. "myDemo.db was created by a different version of the software".
Can someone help ? What do I need to use to create the ODBC and connect to that database? Thanks
The error that I get, when trying to use ODBC:
ERROR [08001] [Sybase][ODBC Driver]Unable to connect to database server
ERROR [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).
Code
string conStr = "Driver={Sybase SQL Anywhere 5.0};Dsn=Prima;uid=dba;PWD=test"; OdbcConnection conn = new OdbcConnection(conStr); conn.Open(); string sql = "select count(*) from ClienteCorretor"; OdbcCommand cmd = new OdbcCommand(sql, conn); int result = cmd.ExecuteNonQuery(); if (conn.State != ConnectionState.Closed) conn.Close();
This configuration will not work. The SQL Anywhere 5.5 ODBC driver (wod50t.dll
) is only an ODBC 2.0 compliant driver and does not have an exported function SQLSetEnvAttr
(available in ODBC 3.0). The ADO.NET OdbcConnection
expects an ODBC 3.0-compatible driver.
Are you in a position to migrate your SQL Anywhere 5.5 to a higher SQL Anywhere database version? (This would also allow you to use our ADO.NET driver directly in .NET instead of trying to use OdbcConnection
).
You really shouldn't be developing new applications on an unsupported database version as we will have limited options to help you if you run into other problems with this development process or while operating in prodcution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just in case migrating the v5 database itself is not feasible: AFAIK, a v9 database server (which has a ADO.Net driver) would allow you to run that v5 database...
The full version is no longer available for purchase (for production deployment), nor is the developer version (for testing). SQL Anywhere 9.0.x has been end-of-life'd. Also see this question here.
In that case, you may have to change how you're planning to write your new program. If you need to stay with the SA 5.x engine / database, you'll be limited developing with an ODBC 2.0 interface with the SA 5.x ODBC driver - OdbcConnection
can't use that.
If you really wanted to stay in .NET, this would mean you would have to write some kind of COM/Interop native C/C++ "wrapper" that makes only native ODBC 2.0 calls out to the SA 5.x ODBC driver (via pinvoke) and returns the data to the managed environment.
(i.e. You need to prevent all SQLSetEnvattr
calls (and other ODBC 3.0 calls) against the ODBC driver).
User | Count |
---|---|
66 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.