ADO访问ACCESS 的语句的问题。

powgu 2005-05-28 01:09:17
登录页面的密码验证:
-------------------------------------------------
SQL="Select * From Users Where user='"&userid& "'"
SQL=SQL&"And password ='"&password& "'"

Set rs=GetMdbRs("tree.mdb",SQL,3,"") ++++++这句查询语句不能执行呀!
--------------------------------------
Function GetMdbRs( FileName, Source, Cursor, Password )
Dim conn, rs
Set conn = GetMdbConnection( FileName )
If conn Is Nothing Then Exit Function
Set rs = Server.CreateObject("ADODB.Recordset")
If Err.Number <> 0 Then Exit Function
rs.Open source, conn, Cursor, 2
If Err.Number <> 0 Then Exit Function
Set GetMdbRs=rs
End Function
----------------------------------------
Function GetMdbConnection(FileName)
Dim Provider, DBPath
Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"
DBPath = "Data Source=" & Server.MapPath(FileName)
Set GetMdbConnection = GetConnection( Provider & DBPath)
End Function
...全文
71 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
powgu 2005-05-28
  • 打赏
  • 举报
回复
呵,网上DOWN 下来的。
我也觉得不错。
patchclass 2005-05-28
  • 打赏
  • 举报
回复
GetMdbRs( FileName, Source, Cursor, Password )
Password 参数怎么没有用啊?会不会是你只copy了一部分?
qunluo 2005-05-28
  • 打赏
  • 举报
回复
晕,不错的代码!那里来的!
powgu 2005-05-28
  • 打赏
  • 举报
回复
Function GetConnection( Param )
Dim conn

On Error Resume Next
Set GetConnection = Nothing
Set conn = Server.CreateObject("ADODB.Connection")
If Err.Number <> 0 Then Exit Function

conn.Open Param
If Err.Number <> 0 Then Exit Function
Set GetConnection = conn
End Function

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧