发一个ASP的ADODB类代码(3)
End Sub
'********打开数据库链接******************
Private Sub AccessConn()
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath(SqlAccess) &";Persist Security Info=False"
End Sub
Private Sub Sql2kConn()
connstr = "driver={SQL server};server="&SqlServer&";uid="&SqlUser&";pwd="&SqlPass&";database="&SqlDbName
End Sub
Private Sub Sql2k05Conn()
connstr="Provider=SQLNCLI.1;Password="&SqlPass&";User ID="&SqlUser&";Initial Catalog="&SqlDbName&";Data Source="&SqlServer
End Sub
Private Sub OpenConn(db_class)
dbclass = db_class
select case db_class
case "access":call AccessConn()
case "sql2000":call Sql2kConn()
case "sql2005":call Sql2k05Conn()
end select
on error resume next
set conn = server.CreateObject("adodb.Connection")
内容版权声明:除非注明,否则皆为本站原创文章。