这种情况是怎么连接数据库的?

来源:百度知道 编辑:UC知道 时间:2024/05/25 14:59:26
以下是一段限制访问后台的代码
其他后台文件包含此页
我始终不明白他是怎么连接数据库的!没有包含conn文件啊!
<%
'判断是否是外部访问系统的后台页面(略)
AdminName=replace(session("AdminName"),"'","")
if AdminName="" then
call CloseConn()
response.redirect "Admin_login.asp"
end if
sqlGetAdmin="select * from Admin where UserName='" & AdminName & "'"
set rsGetAdmin=server.CreateObject("adodb.recordset")
rsGetAdmin.open sqlGetAdmin,conn,1,1
if rsGetAdmin.bof and rsGetAdmin.eof then
rsGetAdmin.close
set rsGetAdmin=nothing
call CloseConn()
response.redirect "Admin_login.asp"
end if
AdminPurview=rsGetAdmin("Purview")
AdminPurview_News=rsGetAdmin("AdminPurview_Article")
AdminPurview_Soft=rsGetAdmin("AdminPurview_Soft")
AdminPurview_Photo=rsGetAdmin("AdminPurview_Photo")
AdminPurview_Guest=rsGetAdmin(

它封装了~~~

call CloseConn()

用vb吧。我最近也在封装,把连接语句放在.dll文件中。~~~~

即使有源码,你也无法解开dll。都是乱麻。

代码没发全吧...

To JLKame:
call CloseConn()不是连接数据库的,是关闭..

不象是封到DLL里了,只是封到函数里了

连接数据库用的是这个
rsGetAdmin.open sqlGetAdmin,conn,1,1
rsGetAdmin应该是ADO的RecordSet