I’m getting ”Data type mismatch in criteria _expression_” error when trying to insert or update DateTime fields in Access DB.

Problem occurs only when culture settings are different in web server and db.
In ASPX pages System.Thread.CurrentThread.CurrentCulture is Finnish ”fi-FI”, but default culture setting in server is ”en-us”.
This means that in ASPX page dates are shown in dd.mm.yyyy format, but in Windows and Access date format is mm/dd/yyyy

 

I verified the problem with running same insert and update clauses with .NET OleDbCommand and it worked fine.

Error occurs only when using Ibatis and it’s OleDb1.1 provider.

 

Currently I resolved problem by setting culture in code to ”en-us” right before calling mapper.Insert or mapper.Update methods, but this ain’t very good solution J

Any ideas how to resolve problem?

 

 

 

--------------------------------------------

Mr Jouni Karppinen tel. +358 44 567 9478
Software Designer addr. Microkatu 1, PL 1188
Entegra Oy 70211 KUOPIO FINLAND
www.entegra.fi Integrating Enterprises and Information



 

Reply via email to