ASP打开数据库做判断怎么弄
dimconn,mdbfilemdbfile=server.mappath("1.mdb")setconn=server.createobject("adodb.conn...
dim conn,mdbfile
mdbfile=server.mappath("1.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};uid=admin;pwd=111111;dbq="&mdbfile
set rs=server.createobject("adodb.recordset")
sql="select * from qu1 where dingdan="&order_no ‘order_no是个数字变量
if not rs.eof then ’如果存在该记录
response.Write "您已经提交完毕,请勿重复提交!"
else
rs.open sql,conn,1,3
rs.addnew
rs("usename") = request("usename")
rs("yuan") = request("yuan")
rs("dingdan") = request("order_no")
rs.update
rs.close
set rs = nothing
conn.close
set conn= nothing
end if
该代码好像没用。求高手看看那里错了? 展开
mdbfile=server.mappath("1.mdb")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};uid=admin;pwd=111111;dbq="&mdbfile
set rs=server.createobject("adodb.recordset")
sql="select * from qu1 where dingdan="&order_no ‘order_no是个数字变量
if not rs.eof then ’如果存在该记录
response.Write "您已经提交完毕,请勿重复提交!"
else
rs.open sql,conn,1,3
rs.addnew
rs("usename") = request("usename")
rs("yuan") = request("yuan")
rs("dingdan") = request("order_no")
rs.update
rs.close
set rs = nothing
conn.close
set conn= nothing
end if
该代码好像没用。求高手看看那里错了? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询