Data Type Mismatch; How do I use Numbers and the Connect

Results 1 to 2 of 2

Thread: Data Type Mismatch; How do I use Numbers and the Connect

  1. #1
    Join Date
    Dec 1969
    Posts
    206

    Default Data Type Mismatch; How do I use Numbers and the Connect

    I am using hyperlinks with something like ?search=283 at the end to get information across pages and into an SQL statement so I can have a database run site. The problem I have is when I use numbers as the criteria (such as above) the following error occurs:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e07&#039 [Microsoft][ODBC Microsoft Access 97 Driver] Data type mismatch in criteria expression. /levelframe.asp, line 26 <BR><BR>Line 26 looks like this: <BR> rs.open strSQL, connectme<BR><BR>I think It is just something really simple but I would appreciate the help. Also, I think my SQL statement needs to be changed if the strSQL is changed. The SQL statement looks like this:<BR><BR>strSQL= "SELECT * FROM products WHERE itemgroup=&#039"&Searchtext&"&#039"<BR><BR>Anyway, I would appreciate the help.<BR><BR>Brandon<BR>

  2. #2
    John Harvey Guest

    Default RE: Data Type Mismatch; How do I use Numbers and the Connect

    Is the field "itemgroup" a varchar, or is it a(n) (long)integer? You are using the single quotes, which denote a string. Try using this statement instead:<BR>strSQL = "SELECT * FROM products WHERE itemgroup=" & Searchtext<BR>Regards,<BR>John Harvey<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •