[求助]高手帮忙----------在线等
我想在数据库中记录来访者(user_name)的来访时间,离开时间,ip等.写了个global.asa文件放在根目录,没有提示错误但是数据就是写不进去,请高手帮忙看下问题在那里?小弟先谢过了!!global.asa文件
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub session_onstart
session("ip")=Request.ServerVariables("REMOTE_ADDR")
session("stime")=now()
application.Lock
if application("clicks")="" then
application("clicks")=0
end if
application("clicks")=application("clicks")+1
application.UnLock
End Sub
Sub Session_Onend
dim strProvider
dim strPsd
dim strDBPath
application.Lock
set conn=server.createobject("ADODB.CONNECTION")
strProvider="Provider=Microsoft.Jet.OLEDB.4.0;"
strDBPath="Data Source=" & Server.MapPath("/lw/database/article.mdb")
strPsd=";Jet OLEDB:Database Password=vivi4124"
conn.open strProvider & strDBPath & strPsd
SQL = "insert into record(user_name,stime,etime,ip) values('"&session("user_name")&"','"&session("stime")&"','"&now()&"','"&session("ip")&"')"
conn.Execute(SQL)
conn.Close
set conn=nothing
application.UnLock
End Sub
</SCRIPT>