ADO访问数据库整理

DSN方式
 
DSN里面都是ODBC驱动
 
Driver do Microsoft Access (*.mdb) 
Microsoft Access Driver (*.mdb)
Microsoft Access-Treiber (*.mdb)    ODBCJT32.DLL
 
Microsoft ODBC for Oracle  MSORCL32.DLL
 
SQL Server SQLSRV32.DLL
 
Oracle in OraHome92 odbc32.dll
 
DSN Less方式
 
1 ODBC方式
 
ADO 缺省值是MSDASQL,此外还有MSIDXS和ADSDSOObject
 
Oracle
"Provider=MSDASQL;DRIVER={Microsoft ODBC for ORACLE};UID=User;PWD=Password;Server=Your_TNSNames_Alias"
 
Access
"Provider=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=zjgadb/zjsjdb.mdb;DefaultDir=;"
 
MS SQLServer
"Provider=MSDASQL;Driver={SQL Server};Server=localhost;User ID=sa;Password=sa;Data Source=zcps"
"Provider=MSDASQL;Driver={SQL Server};Server=localhost;Uid=sa;Pwd=sa;Database=zcps"
 

2 OLE DB方式
 
ADO2.0/2.1提供的OLE Provider:
 
Oracle:
MSDAORA (OLE DB Provider for Oracle)
    "Provider=msdaora;Data Source=MyOracleDB;User Id=UserName;Password=asdasd;" (MS Provider)
    "Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=Username;Password=asdasd;" (Oracle)
 
Access:
Microsoft.Jet.OLEDB.3.51(OLE DB Provider for Microsoft Jet( for ACCESS))
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User Id=admin;Password=;"
 
MS SQLServer:
SQLOLEDB(Microsoft SQL Server OLE DB Provider)
    "Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
 
 


Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=496947


你可能感兴趣的:(数据库)