conn.asp:
<%
dim conn
dim connstr
on error resume next
connstr="DBQ="+server.mappath("hbposv6.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
%>
search.asp:
<form method="POST" action="result.asp">
<input type="text" name="card_id" size="30">
<input type="submit" value="查询" name="B1">
</form>
result.asp:
<!--#include file="conn.asp"-->
<%
s_id=replace(card_id," ","")
set rs=conn.execute("select*from t_rm_vip_info where (card_id = '"&s_id&"')")
if rs.eof then
response.write "查询的ID不存在"
response.end
end if
response.write "会员号:" & s_id & "<br>"
response.write "总积分:" & rs("acc_num")
response.write "消费积分:" & rs("dec_num")
rs.close()
set rs=nothing
conn.close()
set conn=nothing
%>