ASP连接各类数据库的方式
Access
- ConnStr = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & Server.MapPath(Path) & ";Jet OLEDB:Database Password=" & Password & ";"
复制代码
Mssql
- ConnStr = "Provider=Sqloledb;Data Source=" & DbIP & "," & DbPort & ";Initial Catalog=" & DbName & ";Persist Security Info=True;User ID=" & DbUid & ";Password=" & DbPwd & ";Connect Timeout=900;"
复制代码
Sqlite
- ConnStr = "Driver={SQLite3 ODBC Driver};Database=" & Server.MapPath(Path) & ";"
复制代码 Mysql
- ConnStr = "Driver={Mysql ODBC 5.3 Unicode Driver};Server=" & DbIP & ";Database=" & DbName & ";Uid=" & DbUid & ";Password=" & DbPwd & ";Port=" & DbPort & ";"
复制代码 |