除非你用远程登录软件Logon ISP的服务器,否则你是没有办法通过DSN连接数据库。下面介绍几种连接方法,让你超越与你的ISP之间的空间距离,让你连接数据库变得简单:
1.SQL Server
<%
cstr = "Provider=SQLOLEDB;Server=
;database=;"
cstr = cstr & "network=DBMSSOCN;uid=;pwd="
set conn = server.createobject("adodb.connection")
conn.open cstr
' 利用Network=DBMSSOCN方式连接可以避免管理命名引起的错误
%>
2.Oracle
<%
cstr = "Provider=OraOLEDB.Oracle;Server=;Data "
cstr = cst & "Source=;User ID=;Password="
set conn = server.createobject("adodb.connection")
conn.open cstr
%>
3. Access
<%
cstr = "Driver={Microsoft Access Driver (*.mdb)};DBQ="
cstr = cstr & server.mappath("/")
set conn = server.createobject("adodb.connection")
conn.open cstr
%>
4.如果你安装了Jet 4.0,用这种方法连接效果更好.
<%
cstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
cstr = cstr & server.mappath("/")
set conn = server.createobject("adodb.connection")
conn.open cstr
%>