Strange problem!!!

Results 1 to 4 of 4

Thread: Strange problem!!!

  1. #1
    Big Al Guest

    Default Strange problem!!!

    what I have is an SQL query which is this <BR><BR>varid = request("user_id")<BR><BR>SQL = "SELECT * FROM user_questions WHERE q_id = &#039" & varid & "&#039"<BR><BR>But I get an ADO error because of the, varid. This value is a number. when I put a value into the SQL instead of varid it works. anyone know whats going on it&#039s driving me nuts.... At the moment I get the error <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

  2. #2
    AA Guest

    Default RE: Strange problem!!!

    Is the field q_id in user_questions a int type or varchar?<BR>if it is int then change the sql to <BR>SQL = "SELECT * FROM user_questions WHERE q_id =" & varid <BR>and see

  3. #3
    Join Date
    Dec 1969

    Default RE: Strange problem!!!

    If q_id is a number datatype then you don&#039t put the " &#039 " on each end. Just do:<BR><BR>SQL = "SELECT * FROM user_questions WHERE q_id=" & varid<BR><BR>Also - make sure that in the form or before you do the query that you check that the user has entered a valid number or you&#039ll generate errors.

  4. #4
    Big Al Guest

    Default Thanks Guys!

    Thanks for your help guys it all works now. <BR>That was driving me mad.....

Posting Permissions

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