Nmagsaysay
asked on
Login Error Message
I have created a login asp page. When it is run on IIS, an error occurs. How do I resolve the error?
Thanks!
This is the error after lauching on IIS. (Access Data Base and ASP on Dreamweaver MX 2004)
Technical Information (for support personnel)
• Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
/cats/log.asp, line 35
• Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
• Page:
POST 43 bytes to /cats/log.asp
• POST Data:
textfield=Test&textfield2= 222&Submit =Submit
This is my log.asp file:
1. <%@LANGUAGE="VBSCRIPT"%>
2. <!--#include file="Connections/conCats. asp" -->
3. <%
4. Dim Recordset1
5. Dim Recordset1_numRows
6.
7. Set Recordset1 = Server.CreateObject("ADODB .Recordset ")
8. Recordset1.ActiveConnectio n = MM_conCats_STRING
9. Recordset1.Source = "SELECT UseName, UsePassword FROM [CatsTable]"
10. Recordset1.CursorType = 0
11. Recordset1.CursorLocation = 2
12. Recordset1.LockType = 1
13. Recordset1.Open()
14.
15. Recordset1_numRows = 0
16. %>
17. <%
18. ' *** Validate request to log in to this site.
19. MM_LoginAction = Request.ServerVariables("U RL")
20. If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request. QueryStrin g)
21. MM_valUsername=CStr(Reques t.Form("te xtfield"))
22. If MM_valUsername <> "" Then
23. MM_fldUserAuthorization=""
24. MM_redirectLoginSuccess="i ndex.html"
25. MM_redirectLoginFailed="lo g.asp"
26. MM_flag="ADODB.Recordset"
27. set MM_rsUser = Server.CreateObject(MM_fla g)
28. MM_rsUser.ActiveConnection = MM_conCats_STRING
29. MM_rsUser.Source = "SELECT UseName, UsePassword"
30. If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
31. MM_rsUser.Source = MM_rsUser.Source & " FROM Cats Table WHERE UseName='" & Replace(MM_valUsername,"'" ,"''") &"' AND UsePassword='" & Replace(Request.Form("text field2")," '","''") & "'"
32. MM_rsUser.CursorType = 0
33. MM_rsUser.CursorLocation = 2
34. MM_rsUser.LockType = 3
35. MM_rsUser.Open
36. If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
37. ' username and password match - this is a valid user
38. Session("MM_Username") = MM_valUsername
39. If (MM_fldUserAuthorization <> "") Then
40. Session("MM_UserAuthorizat ion") = CStr(MM_rsUser.Fields.Item (MM_fldUse rAuthoriza tion).Valu e)
41. Else
42. Session("MM_UserAuthorizat ion") = ""
43. End If
44. if CStr(Request.QueryString(" accessdeni ed")) <> "" And false Then
45. MM_redirectLoginSuccess = Request.QueryString("acces sdenied")
46. End If
47. MM_rsUser.Close
48. Response.Redirect(MM_redir ectLoginSu ccess)
49. End If
50. MM_rsUser.Close
51. Response.Redirect(MM_redir ectLoginFa iled)
52. End If
53. %>
54. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
55. <html>
Thanks!
This is the error after lauching on IIS. (Access Data Base and ASP on Dreamweaver MX 2004)
Technical Information (for support personnel)
• Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
/cats/log.asp, line 35
• Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
• Page:
POST 43 bytes to /cats/log.asp
• POST Data:
textfield=Test&textfield2=
This is my log.asp file:
1. <%@LANGUAGE="VBSCRIPT"%>
2. <!--#include file="Connections/conCats.
3. <%
4. Dim Recordset1
5. Dim Recordset1_numRows
6.
7. Set Recordset1 = Server.CreateObject("ADODB
8. Recordset1.ActiveConnectio
9. Recordset1.Source = "SELECT UseName, UsePassword FROM [CatsTable]"
10. Recordset1.CursorType = 0
11. Recordset1.CursorLocation = 2
12. Recordset1.LockType = 1
13. Recordset1.Open()
14.
15. Recordset1_numRows = 0
16. %>
17. <%
18. ' *** Validate request to log in to this site.
19. MM_LoginAction = Request.ServerVariables("U
20. If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.
21. MM_valUsername=CStr(Reques
22. If MM_valUsername <> "" Then
23. MM_fldUserAuthorization=""
24. MM_redirectLoginSuccess="i
25. MM_redirectLoginFailed="lo
26. MM_flag="ADODB.Recordset"
27. set MM_rsUser = Server.CreateObject(MM_fla
28. MM_rsUser.ActiveConnection
29. MM_rsUser.Source = "SELECT UseName, UsePassword"
30. If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
31. MM_rsUser.Source = MM_rsUser.Source & " FROM Cats Table WHERE UseName='" & Replace(MM_valUsername,"'"
32. MM_rsUser.CursorType = 0
33. MM_rsUser.CursorLocation = 2
34. MM_rsUser.LockType = 3
35. MM_rsUser.Open
36. If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
37. ' username and password match - this is a valid user
38. Session("MM_Username") = MM_valUsername
39. If (MM_fldUserAuthorization <> "") Then
40. Session("MM_UserAuthorizat
41. Else
42. Session("MM_UserAuthorizat
43. End If
44. if CStr(Request.QueryString("
45. MM_redirectLoginSuccess = Request.QueryString("acces
46. End If
47. MM_rsUser.Close
48. Response.Redirect(MM_redir
49. End If
50. MM_rsUser.Close
51. Response.Redirect(MM_redir
52. End If
53. %>
54. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
55. <html>
ASKER
I removed the "[]" and I received another error message:
Technical Information (for support personnel)
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
/cats/log.asp, line 13
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Technical Information (for support personnel)
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
/cats/log.asp, line 13
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Have you verified the connection to the database and that your table is named correctly?
there was a space in your table name on line 35. it should look like this:
MM_rsUser.Source = MM_rsUser.Source & " FROM CatsTable WHERE UseName='" & Replace(MM_valUsername,"'" ,"''") &"' AND UsePassword='" & Replace(Request.Form("text field2")," '","''") & "'"
-Trevor
MM_rsUser.Source = MM_rsUser.Source & " FROM CatsTable WHERE UseName='" & Replace(MM_valUsername,"'"
-Trevor
Yeah, are you sure the table's name is CatsTable and it exists in the database?
ASKER
The database connection test reports successful. I can see the database table and its contents.
The mdb name: "cats.mdb"
The table name: "Cats Table"
Server: IIS
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
/cats/log.asp, line 13
Line 13 Recordset1.Open()
The mdb name: "cats.mdb"
The table name: "Cats Table"
Server: IIS
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
/cats/log.asp, line 13
Line 13 Recordset1.Open()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It worked!!!
Thanks!
Thanks!
great, you're welcome
[CatsTable] with brackets? have never seen that. What about:
SELECT UseName, UsePassword FROM CatsTable