【www.gdgbn.com--php与数据库】
<%
"option explicit
dim startime,conn,connstr,db,rs,rs_s,rs_s1
startime=timer()
db="bbhtgl/%^&$%/#.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
数据库教程连接代码
set rs_2=server.CreateObject("adodb.recordset")
rs_2.open "select * from system",conn,1,1
if not rs_2.eof then
banquan=rs_2("banquan")
beian=rs_2("beian")
zzywz=rs_2("zzywz")
kfqq=rs_2("qq")
kfemail=rs_2("email")
kftel=rs_2("tel")
kfdpdz=rs_2("dpdz")
kfww=rs_2("ww")
shuchu=rs_2("shuchu")
fang=rs_2("fang")
end if
rs_2.close
set rs_2=nothing
%>
<% url="http://" & Request.ServerVariables("HTTP_HOST") & Mid(Request.ServerVariables("URL"),1,InStrRev(Request.ServerVariables("URL"),"/"))
HomeUrl=url
Session("HomeUrl")=HomeUrl %>