Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEWBIE Really needs HELP

Status
Not open for further replies.

ScottNomus

Programmer
Jun 27, 2001
33
US
I have had a lot of help concerning this but I am still not sure as to what else needs to be done concerning this form.
Here is the code from the two pages and the error message I am getting in the web browser.

1st. ***FORM***CODE****
</head>
<div align=&quot;center&quot;>
<p><img src=&quot;../images/Nomus%20Logo%20.JPG&quot; width=&quot;335&quot; height=&quot;256&quot;></p>
<Form Method=Post Action=&quot;myasppage.asp&quot;>
<p>User Name
<input type=&quot;text&quot; name=&quot;textfield&quot; id=&quot;textfield&quot;>
</p>
<p>Password
<input type=&quot;password&quot; name=&quot;textfield2&quot; id=&quot;textfield2&quot;>
</p>
<p>Company
<select name=&quot;select&quot; width=&quot;5&quot;>
</select>
</p>
<input type=&quot;submit&quot; value=&quot;LogIn&quot;>
<input type=&quot;reset&quot; value=&quot;Reset&quot;>
</form>
</div>
</html>

***2nd Form Code****
<div align=&quot;center&quot;>
<p><img src=&quot;../images/Nomus%20Logo%20.JPG&quot; width=&quot;335&quot; height=&quot;256&quot;></p>
<p>&nbsp;</p>
</div>
<%
username=Request.Form(&quot;textfield&quot;)
pass=Request.Form(&quot;textfield2&quot;)

Session.timeout = 20
If IsObject(Session(&quot;WebCustomer_conn&quot;)) Then
Set conn = Session(&quot;WebCustomer_conn&quot;)
Else
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.open &quot;WebCustomer&quot;,&quot;Admin&quot;,&quot;&quot;
Set Session(&quot;WebCustomer_conn&quot;) = conn
End If
%>


<%
If IsObject(Session(&quot;RS_Frm_Password_customer&quot;)) Then
Set tempRS = Session(&quot;RS_Frm_Password_customer&quot;)
Else
set RSUsername = conn.execute (&quot;SELECT * User_table.Company, User_table.CompanyNum FROM User_table ORDER BY User_table.Company &quot;)
Set tempRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
tempRS.Open sql, conn, 3, 3
Set Session(&quot;RS_Frm_Password_customer&quot;) = tempRS
tempRS.MoveFirst
End If
tempRS.MoveLast
%>
<%
username=Request.Form(&quot;textfield&quot;)
pass=Request.Form(&quot;textfield2&quot;)
'verify password and user name
Session.timeout = 20
If IsObject(Session(&quot;WebCustomer_conn&quot;)) Then
Set conn = Session(&quot;WebCustomer_conn&quot;)
Else
Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
conn.open &quot;WebCustomer&quot;,&quot;Admin&quot;,&quot;&quot;
Set Session(&quot;WebCustomer_conn&quot;) = conn
End If
%>


<%
If IsObject(Session(&quot;RS_Frm_Password_customer&quot;)) Then
Set tempRS = Session(&quot;RS_Frm_Password_customer&quot;)
Else
set RSUsername = (&quot;SELECT User_table.Company, User_table.CompanyNum FROM User_table ORDER BY User_table.Company &quot;)
Set tempRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
tempRS.Open sql, conn, 3, 3
Set Session(&quot;RS_Frm_Password_customer&quot;) = tempRS
tempRS.MoveFirst
End If
tempRS.MoveLast
%>

****Error Message****
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '* User_table.Company'.

/web customer/myasppage.asp, line 25

All help Greatly appreciated.

Like I said I am really new to ASP and database connection.
 
Have you tried running this query in Access
(&quot;SELECT * User_table.Company, User_table.CompanyNum FROM User_table ORDER BY User_table.Company &quot;)

See if the queries work in Access
 
SELECT * User_table.Company, User_table.CompanyNum FROM User_table ORDER BY User_table.Company

is not a valid query.

SELECT *, User_table.Company, User_table.CompanyNum FROM User_table ORDER BY User_table.Company

is valid

here's the thing. * gives you all the columns by default, so you will get company and companyNum within the *. So why get them a second time?

Preferred mehod:
SELECT * FROM User_table ORDER BY User_table.Company

that should do the trick for you

hth
leo leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top