[求助]
错误类型:
ADODB.Connection (0x800A0E78)
对象关闭时,不允许操作。
/winweb/网页/gbook.asp, 第 25 行
代码如下:
<%
dim name
dim email
dim subject
dim memo
function sqlstr(data)
sqlstr="'" & Replace(data,"'","'") & "'"
end function
name=request.form("name")
email=request.form("email")
subject=request.form("subject")
memo=request.form("memo")
name=left(name,40)
email=left(email,80)
subject=left(subject,127)
name=trim(name)
email=trim(email)
subject=trim(subject)
Application.Lock
set conn=Server.CreateObject("adodb.connection")
dbpath=server.mappath("gbook.mdb")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & dbpath '第25行
sql="Insert Into guestbook(姓名,email,主题,留言) values("
sql=sql & sqlstr(name) & ","
sql=sql & sqlstr(email) & ","
sql=sql & sqlstr(subject) & ","
sql=sql & sqlstr(memo) & ")"
conn.execute sql
Application.Unlock
conn.close
set conn=nothing
response.write "<h2 align=center>留言成功,请<a href=""gform.htm"">返回</a>留言页面</h2>"
%>