FYPJ
asked on
Date mismatch when using number type in Access
Hi,
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("topic ID")
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?
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("topic
Cmd = New OleDb.OleDbCommand("Select
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK thanks for both the answers.
Cmd = New OleDb.OleDbCommand("Select