Date mismatch when using number type in Access
Posted on 2004-04-17
I used to use String type for all my variable types in my Access DB even for variables with number types like IDs.
Due to some constraints i have to use Number types for my IDs now.
Here is an example of my SQL which has a data mismatch error.
Dim item As Integer
item = Request.QueryString("topicID")
Cmd = New OleDb.OleDbCommand("Select topicID ForumPosts where topicID ='" + item + "'", Conn)
I have also tried enclosing item in only double quotes "+item+" or single quotes '+item+', and still the same error occurs.
It produces a data mismatch error. So what is the problem lying here?