Print Page | Close Window

Data type mismatch in criteria expression

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=569
Printed Date: 29 March 2026 at 6:48am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Data type mismatch in criteria expression
Posted By: mangobelle
Subject: Data type mismatch in criteria expression
Date Posted: 27 February 2003 at 7:37am

Hi there:)

Pls could anyone tell me how to solve this problem. I  have build a website with a login page using ultradev. I have uploaded the site online everything seems fine except for my login page when I type in the password and press the sumbit buttom I get an error message  saying

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

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

I have gone back into the code and this is what line 21 code looks like

 MM_rsUser.Open();
  if (!MM_rsUser.EOF || !MM_rsUser.BOF) {
    // username and password match - this is a valid user
    Session("MM_Username") = MM_valUsername;
    if (MM_fldUserAuthorization != "") {
      Session("MM_UserAuthorization") = String(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value);
    } else {
      Session("MM_UserAuthorization") = "";
    }
    if (String(Request.QueryString("accessdenied")) != "undefined" && false) {
      MM_redirectLoginSuccess = Request.QueryString("accessdenied");
    }
    MM_rsUser.Close();
    Response.Redirect(MM_redirectLoginSuccess);
  }
  MM_rsUser.Close();
  Response.Redirect(MM_redirectLoginFailed);
}
%>.

I have tried understanding this problem by searching online for a solutions .....I have found different suggestions on the solution ...but none too specific as I am a bit of a novice regards this area ...I am really confused on how to solve this problem.

Pls I would be grateful if anyone could tell me what to do to solve this problem.



-------------
Many Thanks
mangobelle



Replies:
Posted By: MorningZ
Date Posted: 27 February 2003 at 8:26am
which line is #21?

and that error means you are trying to do something with an unhandled data type.. for example, adding a string to a number, etc

what language is that? JSP?

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: mangobelle
Date Posted: 27 February 2003 at 9:05am

Hi MorningZ:)

Thanks for your reply to my problem. Yes the language is javascript.

Line #21 is  MM_rsUser.Open();

Your explanation ..made recheck my database table the password has a text field , so I have change this to number field.

Does this mean I need to reload the (.mdb file) to the server? and is there any other changes I need to make due to this error???

 



-------------
Many Thanks
mangobelle


Posted By: vdub
Date Posted: 02 March 2003 at 2:45am

I have alwase found that error when you use the wrong type of data in a database. like text insted on number like you just said.

 

 




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