0

Saving data in ms access database from software on 32-bit platform runs perfectly well..But when I try to save data using same software on 64-bit application throws below error:
**System.Runtime.InteropServices.ComException. Datatype mismatch in criteria expresssion. **
I have declared some variables as SHORT in my application and in database those fields are defined as Long Integer or Integer..
Eg. WardNo variable in software is defined as SHORT and in ms Access database,WardNo is stored As Integer..
On 32-bit,it doesnt show any error,but on 64-bit machine,error occurs..Please help me to solve this...

2
Contributors
1
Reply
13
Views
4 Years
Discussion Span
Last Post by Begginnerdev
0

You can try to force the software to use 32 bit datatypes with a statement like this.

Try
    '...Your Code.
    Dim shortVal As Short 'Replace this with your short variable.
    Dim i32Converted As Int32 = Convert.ToInt32(shortVal) 'Commit the 32bit value to the database.
    '...Your Code to update database.
Catch ex As Exception
    MsgBox(ex.toString)
End Try

Edited by Begginnerdev

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.