X
Xg__yeqingshan
Unregistered / Unconfirmed
GUEST, unregistred user!
一个DBCONN.ASP文件
<%
sub opendb()
set conn=server.CreateObject("ADODB.CONNECTION"
conn.open "driver={sql server};server=1E6CBE1AB04B498/XG__SATAN;uid=sa;pwd=447620;database=jiaowu"
set rs=server.CreateObject("ADODB.recordset"
end sub
sub closedb()
set rs=nothing
conn.close
set conn=nothing
end sub
%>
一个CHECK文件
<!--#include file="dbconn.asp"-->
<%
sub student()
opendb()
sql="select * from jw_st_pass where sp_no='"&userid&"'and sp_pwd='"&password&"'"
set rs=conn.execute(sql)
if not rs.eof then
session("stno"=userid
closedb()
response.Redirect("student/studentindex.htm"
else
closedb()
response.Write("id or password error!"
end if
end sub
sub teacher()
opendb()
sql="select * from jw_te_pass where tp_no='"&userid&"'and tp_pwd='"&password&"'"
set rs=conn.execute(sql)
if not rs.eof then
session("teno"=userid
closedb()
response.Redirect("teacher/teacherindex.htm"
else
closedb()
response.Write("id or password error!"
end if
end sub
%>
<%
usertype=request.Form("type"
userid=request.Form("userid"
password=request.Form("password"
if usertype="student"
then
student()
else
if usertype="teacher"
then
teacher()
else
response.Redirect("vistor/vistorindex.htm"
end if
%>
问题提示是:缺少CONN对象
难道不可以在过程中引用其它过程么?
多谢
<%
sub opendb()
set conn=server.CreateObject("ADODB.CONNECTION"
conn.open "driver={sql server};server=1E6CBE1AB04B498/XG__SATAN;uid=sa;pwd=447620;database=jiaowu"
set rs=server.CreateObject("ADODB.recordset"
end sub
sub closedb()
set rs=nothing
conn.close
set conn=nothing
end sub
%>
一个CHECK文件
<!--#include file="dbconn.asp"-->
<%
sub student()
opendb()
sql="select * from jw_st_pass where sp_no='"&userid&"'and sp_pwd='"&password&"'"
set rs=conn.execute(sql)
if not rs.eof then
session("stno"=userid
closedb()
response.Redirect("student/studentindex.htm"
else
closedb()
response.Write("id or password error!"
end if
end sub
sub teacher()
opendb()
sql="select * from jw_te_pass where tp_no='"&userid&"'and tp_pwd='"&password&"'"
set rs=conn.execute(sql)
if not rs.eof then
session("teno"=userid
closedb()
response.Redirect("teacher/teacherindex.htm"
else
closedb()
response.Write("id or password error!"
end if
end sub
%>
<%
usertype=request.Form("type"
userid=request.Form("userid"
password=request.Form("password"
if usertype="student"
then
student()
else
if usertype="teacher"
then
teacher()
else
response.Redirect("vistor/vistorindex.htm"
end if
%>
问题提示是:缺少CONN对象
难道不可以在过程中引用其它过程么?
多谢