which to use OLEDB or ODBC for SYbase

对着背影说爱祢 提交于 2020-01-04 02:34:07

问题


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


回答1:


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';")


来源:https://stackoverflow.com/questions/2926817/which-to-use-oledb-or-odbc-for-sybase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!