Nits
Nits

Reputation: 901

which to use OLEDB or ODBC for SYbase

I am not able to figure out which drivers should I use. Even I don't know what I have.

When I am trying to make the connection string through the .udl file it only shows SYbase ASE OleDB Provider

while in install folder I can see in driver list Syabse Ase ODBC driver but in connection string it is unable to pick up the driver, here I used Driver = (Sybase ASE ODBC Driver)

What should I go for?

Thanks

Upvotes: 3

Views: 4502

Answers (1)

Yorgos
Yorgos

Reputation: 30485

Using udl you have only the possibility to generate a connection string that uses an oledb provider. A Sybase ODBC Connection String would look like this

"ODBC;Driver={SYBASE ASE ODBC Driver};Srvr=myServerName;Database=my_db;UID=myUsername;PWD=myPassword"

Alternativly, you could create an odbc DSN (using ODBC data source adminitration) and then use a connection string like this

"ODBC;DSN=my_DSN;UID=myUsername;PWD=myPassword;"

In case you are connecting through .net, why don't you install the native provider Sybase.Data.AseClient (Adaptive Server Enterprise Managed Provider). In that case the connection string would be like the following

Dim cn As New AseConnection("Data Source='servername';Port='5000';UID='myUsername';PWD='myPassword';Database='my_db';")

Upvotes: 4

Related Questions