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();

asked 13 Dec '12, 06:36

Bruno%20Dumont's gravatar image

Bruno Dumont
21115
accept rate: 0%

edited 15 Mar '13, 17:22

Mark%20Culp's gravatar image

Mark Culp
23.2k9132273


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.

permanent link

answered 13 Dec '12, 11:42

Jeff%20Albion's gravatar image

Jeff Albion
10.7k171174
accept rate: 24%

edited 13 Dec '12, 11:47

2

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...

(13 Dec '12, 12:23) Volker Barth
Replies hidden

Volker, where can I find that version?

(13 Dec '12, 12:55) Bruno Dumont

Thanks Jeff. I know that its an old version, but I have a windows app from another company that uses that version, and I'm developing a .net app to assist my client in their daily needs, that must access the same DB. Unfortunately i cant change it.

(13 Dec '12, 13:03) Bruno Dumont
Replies hidden
1

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.

(13 Dec '12, 15:38) Jeff Albion
2

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).

(13 Dec '12, 15:48) Jeff Albion

So, I can't use the v9 to run the db from v5 =/. ty

(13 Dec '12, 15:53) Bruno Dumont
showing 2 of 6 show all flat view
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×125
×56
×17

question asked: 13 Dec '12, 06:36

question was seen: 6,135 times

last updated: 15 Mar '13, 17:22