datatype mismatch in criteria expression to Access Database

Discussion in 'ASP.NET / ASP.NET Core' started by Bruce, Jan 24, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Bruce

    Bruce DiscountASP.NET Staff

    Dim strabc as Integer

    and remove the single quote in your query, ie. Query = 'Select * from table where abc = ' & strabc

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  2. Hi,


    I get this error "datatype mismatch in criteria expression" in my sql query. One of datatype in my Acceess database is declare as "Number-Long Integer".


    This cause error occur while the datatype mismatch. I'm using asp.net with vbscript to code my page. In my sql query, there is a condition.


    CodeBehind:


    Dim strabc as (Integer/Long/Short/Single,Int32,Int64/Byte...)<- I had try all of this data type but still error!


    strabc = CType(textbox.text,Integer/...)
    Query = "Select * from table where abc = '" &amp; strabc &amp; "'"


    Microsoft Access Data Type:
    abc - Number-Long Integer


    It is easy to use if I declare abc in DB as "Text". IS ANYONE KNOW HOW TO SOLVE IT??? what should delare the variable in my code behind page??


    Thank you very much


    Calvin
     
  3. The solution solved my problem. Thanks for your help.

    Calvin
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page