使用ASP连接4种数据库的方式源码

已为老胡 2025-09-01 AM 21℃ 0条
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 & ";"



标签: none

非特殊说明,本博所有文章均为博主原创。

评论啦~