windows主機數(shù)據庫連接方法
<%
dim conn,connstr
connstr="DBQ="+server.mappath("客戶的access數(shù)據庫文件名")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
SqlServer連接示例:
下例中,創(chuàng)建的數(shù)據庫名為edongtest,用戶名由系統(tǒng)自動指定為edongtest_f,密碼為123456
Set conn = Server.CreateObject("ADODB.Connection")
connstr = "PROVIDER=SQLOLEDB;Server=(IP Addesss);DATABASE=edongtest;UID=edongtest_f;PWD=123456;"
conn.Open connstr