asp写access

来源:互联网 发布:java 清空文件夹内容 编辑:程序博客网 时间:2024/05/20 08:43
<%
'提交留言

Dim user,ip,writetime,info,other
user
=Request("user")
info
=Request("info")
'other=Request("other")

If ip="" then ip=Request.ServerVariables("REMOTE_ADDR")
writetime
=now()

DBPath
=Server.MapPath("myData.mdb")    '数据库存放路径
Strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & DBPath     '连接字符串
Set conn = Server.CreateObject("ADODB.Connection")    '新建一个连接 
conn.open Strconn

'strSQL="INSERT INTO TBL_LYB(User,IPAddress,Time,Info,Other) VALUES('"&user&"','"&ip&"','"&time&"','"&info&"','"&other&"')"
strSQL="INSERT INTO TBL_LYB(User,IPAddress,wTime,Info) VALUES('"&user&"','"&ip&"','"&writetime&"','"&info&"')"
conn.execute strSQL

Response.Write (
"&writeResult=OK")

conn.close
set conn=nothing

%
>
 
原创粉丝点击