4.2 代码分析/实现
连接数据库的代码:
<%
dim db,strcon
strcon="driver={microsoft access driver (*.mdb)};dbq="&server.MapPath("data.mdb")
set db=server.CreateObject("ADODB.Connection")
db.open strcon
%>
管理员登陆模块代码:
if trim(request("yhm"))<>"" and trim(request("mm"))<>"" then
dim rs,strsql ‘接收的数据不为空,执行以下
strsql = "select * from admin where yhm='"&request("yhm")& "' and mm='"& request("mm")& "'" ‘与数据库中信息校验
set rs =conn.execute(strsql)
if not rs.bof and not rs.eof then
session("gly_id")=rs("gly_id")
response.Red