oledb连接字符串转换为ado 数据库连接字符串,下面这句话怎么理解?
本帖最后由 biz_phoenix 于 2013-11-21 21:36:06 编辑
Cnn.ConnectionString = UFLogin.UfDbName.Replace("PROVIDER=SQLOLEDB;", "");
c#实现COM
------解决方案--------------------ado的连接字符串中要有“PROVIDER=SQLOLEDB”,oledb连接字符串则不需要,所以转为ado时,要将UfDbName中的空格替换为PROVIDER=SQLOLEDB,
ADO连接:
Cnn.ConnectionString = "Provider=SQLOLEDB;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=data1;Data Source=localhost;";
oledb连接:
Cnn.ConnectionString = "Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=data1;Data Source=localhost;";