SQL data type mismatch

Results 1 to 2 of 2

Thread: SQL data type mismatch

  1. #1
    Join Date
    Dec 1969

    Default SQL data type mismatch

    Hi I am new to ASP and having some problem in SQL statement :<BR><BR>I passed a querystring to a page and then convert it into a str : <BR><BR>Article = cint(Request.QueryString("articleID"))<BR><BR>In the SQL statement I have :<BR><BR>strSql = "select * from tb_news where ARTICLE = &#039;" & strArticle & "&#039;" <BR><BR>It just returned an error message saying data type mismatch...ARTICLE is a primary field in the ACCESS database where number is generated automatically. It seem to work if I pass any other field as querystring. Is there a way to get round this?<BR><BR>Please help, many thanks<BR><BR>James<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL data type mismatch

    You confused me, but if the ARTICLE is and Integer in your db, remove the &#039;s from your SQL string like<BR>strSql = "select * from tb_news where ARTICLE = " & strArticle<BR>if it&#039;s a string then remove the CInt part

Posting Permissions

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