首页 > 代码库 > ADO中数据库连接字符串的几种写法

ADO中数据库连接字符串的几种写法

转自http://blog.csdn.net/niuzai520/article/details/6778645

MsSql连接:吐舌头

string  value= "http://www.mamicode.com/Data Source=LocalHost;Initial Catalog=DbName;Integrated Security=SSPI";

string  value= "http://www.mamicode.com/Data Source=TC019053;Initial Catalog=DbName;User ID=sa;Password=****";

string  value= "http://www.mamicode.com/server=localhost;database=DbName;User ID=sa;Password=****";

string  value= "http://www.mamicode.com/server=localhost;database=DbName;Integrated Security=SSPI";

MySql连接:生气

string value="http://www.mamicode.com/server=localhost;database=DbName;user id=root;password=‘‘;pooling=false";

SQLite连接:鄙视

string value="http://www.mamicode.com/Data Source=|DataDirectory|/DbName.s3db";

Access连接:难过

[2003] string value="http://www.mamicode.com/Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/MyDb.mdb;"

[2007]  string value="http://www.mamicode.com/Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|/MyDb.accdb;"

 

oracle连接:尴尬

string value="http://www.mamicode.com/Data Source=ProjectOracle;password=****;user ID=system";

 

ADO中数据库连接字符串的几种写法