I am extremely new to ASP and have been given code to try and manipulate to do what it is supposed to be doing. A snippet of the code is below.
The following code was designed to be used with UserID as an assigned number. The UserID is supposed to be text. The information is coming from an Access Database. When I change the UserID field to text in the database the following code does not recognize it and returns an error. How do I change the following code to make it recognize the text field rather than a numerical field.
If szUserID <> "" And szPassword <> "" Then
Set db = Server.CreateObject("ADODB.Connection"
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\Database\Books.mdb;"
db.Open
Set rcUsers = db.Execute("SELECT * FROM OWNERS WHERE ID=" & szUserID)
If rcUsers.BOF And rcUsers.EOF Then
Response.Redirect "UserNotFound.htm"
Else
rcUsers.MoveFirst
If StrComp(rcUsers.Fields("Password", szPassword, vbTextCompare) <> 0 Then
Response.Redirect "BadPassword.htm"
End If
End If
Else
bError = True
End If
Thanks for your help!%-)
The following code was designed to be used with UserID as an assigned number. The UserID is supposed to be text. The information is coming from an Access Database. When I change the UserID field to text in the database the following code does not recognize it and returns an error. How do I change the following code to make it recognize the text field rather than a numerical field.
If szUserID <> "" And szPassword <> "" Then
Set db = Server.CreateObject("ADODB.Connection"
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\Database\Books.mdb;"
db.Open
Set rcUsers = db.Execute("SELECT * FROM OWNERS WHERE ID=" & szUserID)
If rcUsers.BOF And rcUsers.EOF Then
Response.Redirect "UserNotFound.htm"
Else
rcUsers.MoveFirst
If StrComp(rcUsers.Fields("Password", szPassword, vbTextCompare) <> 0 Then
Response.Redirect "BadPassword.htm"
End If
End If
Else
bError = True
End If
Thanks for your help!%-)