C#如何通过连接ODBC连接数据(200分)

  • 主题发起人 HunterTeam
  • 开始时间
H

HunterTeam

Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码如下:
OdbcConnection pDbConn = new OdbcConnection();
pDbConn.ConnectionString = "Provider=MSDASQL.1;Password=abcde;Persist Security Info=True;User ID=defg;Data Source=dfsaf;Initial Catalog=sfsda";
pDbConn.Open();
连接串内容是从Delphi代码中照搬过来的,连接时提示错误“未发现数据源名称并且未指定默认驱动程序”。请问这个连接串究竟该怎么写?
 
Persist Security Info=False;User ID=;Password=;Initial Catalog=;Server=
 
自己解决了,原来就这么写一下就可以了
dsn=dfsaf;UID=defg;PWD=abcde;
散分吧
 

Similar threads

顶部