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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using input fields to Query DB in Front Page

Status
Not open for further replies.

streborr

IS-IT--Management
Jan 16, 2002
98
I'm trying to set up a login page to verify username and password thru a table in a database, if the the username and password are valid I want to send the user to a page that will show information from a database based on what group they're in.
Fields in Table:
user_login_ID, user_name, user_pass, user_group, etc...

Here's my code:
The input fields are from the login page.
and sent to this page.
<body>
<INPUT TYPE=&quot;text&quot; NAME=&quot;ID&quot; value=&quot;<% =Request.Form(&quot;login&quot;) %>&quot; size=&quot;20&quot;></INPUT>
<INPUT TYPE=&quot;text&quot; NAME=&quot;pword&quot; value=&quot;<% =Request.Form(&quot;password&quot;) %>&quot; size=&quot;20&quot;></INPUT>

<%
Set fp_conn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set fp_rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
fp_conn.Open Application(&quot;leadinput1_ConnectionString&quot;)
fp_rs.Open &quot;Select * From tblUser Where user_login_ID = '&quot; & Request.Form(&quot;login&quot;) & &quot;' AND user_pass = '&quot; & Request.Form(&quot;password&quot;) & &quot;'&quot;, fp_conn, 1, 3, 1
%>
<-- this is here just to see if data can be pulled from the DB. -->
<%=FP_FieldVal(fp_rs,&quot;user_group&quot;)%>

<%Set fp_conn = nothing%>
<%Set fp_rs = nothing%>
</body>
</html>

Here's the error I received:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'FP_FieldVal'

/members/leadinput1_interface/Results/editor/users/user_login.asp, line 21

Why wont it return the group that this user belongs to?
 
FP_FieldVal(fp_rs,&quot;user_group&quot;)

FP_FieldVal(fp_rs(&quot;user_group&quot;))

Notice the change in how you need to access the variables from your recordset:

recordset(&quot;fieldName&quot;)

hope that helps! :)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top