Solved

Login Error Message

Posted on 2004-08-13
9
186 Views
Last Modified: 2010-04-25
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.ActiveConnection = 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("URL")
20.      If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
21.      MM_valUsername=CStr(Request.Form("textfield"))
22.      If MM_valUsername <> "" Then
23.      MM_fldUserAuthorization=""
24.      MM_redirectLoginSuccess="index.html"
25.      MM_redirectLoginFailed="log.asp"
26.      MM_flag="ADODB.Recordset"
27.      set MM_rsUser = Server.CreateObject(MM_flag)
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("textfield2"),"'","''") & "'"
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_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
41.      Else
42.      Session("MM_UserAuthorization") = ""
43.      End If
44.      if CStr(Request.QueryString("accessdenied")) <> "" And false Then
45.      MM_redirectLoginSuccess = Request.QueryString("accessdenied")
46.      End If
47.      MM_rsUser.Close
48.      Response.Redirect(MM_redirectLoginSuccess)
49.      End If
50.      MM_rsUser.Close
51.      Response.Redirect(MM_redirectLoginFailed)
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>
0
Comment
Question by:Nmagsaysay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 3

Expert Comment

by:pulupul
ID: 11795057
> "SELECT UseName, UsePassword FROM [CatsTable]"

[CatsTable] with brackets? have never seen that. What about:

SELECT UseName, UsePassword FROM CatsTable
0
 

Author Comment

by:Nmagsaysay
ID: 11797511
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)
0
 
LVL 8

Expert Comment

by:trevorhartman
ID: 11797632
Have you verified the connection to the database and that your table is named correctly?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 8

Expert Comment

by:trevorhartman
ID: 11797648
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("textfield2"),"'","''") & "'"

-Trevor
0
 
LVL 3

Expert Comment

by:pulupul
ID: 11797674
Yeah, are you sure the table's name is CatsTable and it exists in the database?
0
 

Author Comment

by:Nmagsaysay
ID: 11798558
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()

0
 
LVL 8

Accepted Solution

by:
trevorhartman earned 250 total points
ID: 11798561
if the table name is cats table, then in your SQL you need to select FROM [Cats Table]

in the future you should avoid naming tables with spaces in them.

line 9:
Recordset1.Source = "SELECT UseName, UsePassword FROM [Cats Table]"

should cause line 13 to work.  ifyou get an error on line 35, then change line 31 to:

MM_rsUser.Source = MM_rsUser.Source & " FROM [Cats Table] WHERE UseName='" & Replace(MM_valUsername,"'","''") &"' AND UsePassword='" & Replace(Request.Form("textfield2"),"'","''") & "'"


-Trevor
0
 

Author Comment

by:Nmagsaysay
ID: 11798600
It worked!!!

Thanks!
0
 
LVL 8

Expert Comment

by:trevorhartman
ID: 11798603
great, you're welcome
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Spry missing in DWcc 6 330
Unable to Connect Via FTP 109 1,313
can't connect to server via ftp from dreamweaver 22 2,595
What is needed to center a flash image to the center of the page? 4 111
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question