|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
优点:简单易学、开发速度快、有很多年“历史”,能找到非常多别人做好的程序来用、配合activeX功能强大,很多php做不到的asp+activeX能做到,例如银行安全控件ado|excel|毗连数据库|字符串ADO毗连数据库字符串年夜全(VP,Excel,文本,Sybase,.NET等)
ThispagecontainssampleADOconnectionstringsforODBCDSN/DSN-Less,
OLEDBProviders,RemoteDataServices(RDS),MSRemote,MSDataShape.
AlsoincludedareADO.NETconnectionstringsforeach.NETManagedProvider
(SQLClient,OLEDB,andODBC).
Thesesampleconnectionstringsarecompiled
byCarlProthman,aMicrosoftVisualBasicMVP
Enjoy!
TableofContents
ODBCDSNConnectionsDSN
FileDSN
ODBCDSN-LessConnections ODBCDriverforAS/400
ODBCDriverforAccess
ODBCDriverfordBASE
ODBCDriverforExcel
ODBCDriverforMySQL
ODBCDriverforOracle
ODBCDriverforParadox
ODBCDriverforSQLServer
ODBCDriverforSybase
ODBCDriverforSybaseSQLAnywhere
ODBCDriverforText
ODBCDriverforTeradata
ODBCDriverforVisualFoxPro
OLEDBDataLinkConnectionsDataLinkFile(UDL)
OLEDBDataProviderConnections OLEDBProviderforAS/400
OLEDBProviderforActiveDirectoryService
OLEDBProviderforDB2
OLDDBProviderforInternetPublishing
OLEDBProviderforIndexServer
OLEDBProviderforMicrosoftJet
OLEDBProviderforODBCDatabases
OLEDBProviderforOracle(FromMicrosoft)
OLEDBProviderforOracle(FromOracle)
OLEDBProviderforSimpleProvider
OLEDBProviderforSQLServer
RemoteDataService(RDS)ConnectionsRDSDataControl-ConnectProperty
RDSDataControl-URLProperty
ADOURLConnectionsADORecordset
MSRemoteProviderConnectionsMSRemote-Access(Jet)
MSRemote-SQLServer
DataShapeProviderConnections MSDataShape-SQLServer
.NETManagedProviderConnectionsSQLClient.NETManagedProvider(System.Data.SqlClient)
OLEDB.NETManagedProvider(System.Data.OleDb)
ODBC.NETManagedProvider(System.Data.ODBC)
ODBCDSNConnections
UsinganODBCDSN(DataSourceName)isatwostepprocess.
1)YoumustfirstcreatetheDSNviathe"ODBCDataSourceAdministrator"program
foundinyourcomputersControlPanel(orAdministrativeToolsmenuinWindows2000).
MakesuretocreateaSYSTEMDSN(notaUSERDSN)whenusingASP.
Note:YoucanalsocreatetheDSNviaVBcode.
2)Thenusethefollowingconnectionstring-withyourownDSNnameofcourse. ;-)
ODBC-DSN
oConn.Open"DSN=AdvWorks;"&_
"Uid=Admin;"&_
"Pwd=;
YoucanalsocreateanduseaFileDSN.ThenusethefollowingADOConnectionstring:
ODBC-FileDSN
oConn.Open"FILEDSN=c:somepathmydb.dsn;"&_
"Uid=Admin;"&_
"Pwd=;"
Formoreinformation,see:AboutODBCdatasourcesand
HowtoUseFileDSNsandDSN-lessConnections
Note:TheproblemwithDSNisthatUserscan(andwill)modifythem(ordeletebymistake),
thenyourprogramwontworksowell...SoitsbettertouseaDSN-LessorOLEDBProvider
connectionstringwithaTrustedConnectionifpossible!
ODBCDSN-LessConnections
ODBCDriverforAS/400
oConn.Open"Driver={ClientAccessODBCDriver(32-bit)};"&_
"System=myAS400;"&_
"Uid=myUsername;"&_
"Pwd=myPassword;"
Formoreinformation,see: AFastPathtoAS/400Client/Server
ODBCDriverforAccess
ForStandardSecurity:
oConn.Open"Driver={MicrosoftAccessDriver(*.mdb)};"&_
"Dbq=c:somepathmydb.mdb;"&_
"Uid=Admin;"&_
"Pwd=;"
IfyouareusingaWorkgroup(Systemdatabase):
oConn.Open"Driver={MicrosoftAccessDriver(*.mdb)};"&_
"Dbq=c:somepathmydb.mdb;"&_
"SystemDB=c:somepathmydb.mdw;",_
"admin",""
IfMDBislocatedonanetworkshare:
oConn.Open"Driver={MicrosoftAccessDriver(*.mdb)};"&_
"Dbq=myServermySharemyPathmyDb.mdb;"
Formoreinformation,see:</p>缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。 |
|