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