Print Page | Close Window

Please help with Data type mismatch in cr

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2852
Printed Date: 28 March 2026 at 6:52am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Please help with Data type mismatch in cr
Posted By: 288enzo
Subject: Please help with Data type mismatch in cr
Date Posted: 19 May 2003 at 6:21pm
The error tells me that the problem is in the following line:

rsCheckUser.Open strSQL, strCon

The rest is my actual code:

<%
Dim adoCon           
Dim strCon          
Dim rsCheckUser           
Dim strAccessDB      
Dim strSQL           
Dim strUserName      

strUserName = Request.Form("txtUserName")
strAccessDB = ""
Set adoCon = Server.CreateObject("ADODB.Connection")
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};pwd=; DBQ=" & Server.MapPath(strAccessDB)
adoCon.Open strCon
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblUsers.Password FROM tblUsers WHERE tblUsers.UserID ='" & strUserName & "'"
rsCheckUser.Open strSQL, strCon
If NOT rsCheckUser.EOF Then
     If (Request.Form("txtUserPass")) = rsCheckUser("Password") Then
          Session("UserGood") = True
          Set adoCon = Nothing
          Set strCon = Nothing
          Set rsCheckUser = Nothing
          Response.Redirect"authorized.asp?name=" & strUserName
     End If
End If
Set adoCon = Nothing
Set strCon = Nothing
Set rsCheckUser = Nothing
Session("UserGood") = False
Response.Redirect"unauthorized.htm"
%>



Replies:
Posted By: Bliss
Date Posted: 19 May 2003 at 7:15pm
What's the error?


Posted By: 288enzo
Date Posted: 19 May 2003 at 7:27pm
 

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

/check_user.asp, line 16



Posted By: eagle00789
Date Posted: 20 May 2003 at 3:54am

in your strSQL line you have to end it with a ;

this means that your line has to be:

strSQL = "SELECT tblUsers.Password FROM tblUsers WHERE tblUsers.UserID ='" & strUserName & "';"

Greetings Chris



-------------
Using forum at http://www.gravenrode.nl/forum/forum - Gravenrode and http://www.gravenrode.nl/forum/test_forum - here and http://217.121.39.22/forum/test_forum - here



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net