数据连接字符串

SqlServer
(1)ODBC
Driver={SQL Server};Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;
Driver={SQL Server};Server=Aron1;Database=pubs;Trusted_Connection=yes;

oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Driver={SQL Server};Server=Aron1;DataBase=pubs;"
(2)OLE DB, OleDbConnection (.NET)
Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;
Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;

oConn.Provider = "sqloledb"
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Data Source=Aron1;Initial Catalog=pubs;"

Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog= pubs;UserID=sa;Password=asdasd;
(3)SqlConnection (.NET)
Data Source=Aron1;Initial Catalog= pubs;UserId=sa;Password=asdasd;
Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog= pubs;UserID=sa;Password=asdasd;

Access
(1)ODBC
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;SystemDB=C:\mydatabase.mdw;
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Exclusive=1;Uid=admin;Pwd=
(2)OLE DB, OleDbConnection (.NET)
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User Id=admin;Password=;
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet OLEDB:System Database=system.mdw;
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet OLEDB:Database Password=MyDbPassword;

Oracle
(1)ODBC
Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=Username;Pwd=asdasd;
Driver={Microsoft ODBC Driver for Oracle};ConnectString=OracleServer.world;Uid=myUsername;Pwd=myPassword;
(2) OLE DB, OleDbConnection (.NET)
Provider=msdaora;Data Source= MyOracleDB;UserId=UserName;Password=asdasd;
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=Username;Password=asdasd;
Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;
(3)OracleConnection (.NET)
Data Source=Oracle8i;Integrated Security=yes
(4)Core Labs OraDirect (.NET)
User ID=scott; Password=tiger; Host=ora; Pooling=true; Min Pool Size=0;Max Pool Size=100; Connection Lifetime=0
(5)Data Shape
Provider=MSDataShape.1;Persist Security Info=False;Data Provider=MSDAORA;Data Source= orac;userid=username;password=mypw

DSN
DSN=myDsn;Uid=username;Pwd=;" 
FILEDSN=c:\myData.dsn;Uid=username;Pwd=;

Excel
Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=C:\MyExcel.xls;DefaultDir=c:\mypath;
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""

Text
Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=c:\txtFilesFolder\;Extensions=asc,csv,tab,txt;
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\txtFilesFolder\;ExtendedProperties=""text;HDR=Yes;FMT=Delimited""

 

 

 


 

博客园大道至简

http://www.cnblogs.com/jams742003/

转载请注明:博客园

上一篇:UVM1-基础知识篇


下一篇:字符串数组定义