PC Review


Reply
Thread Tools Rate Thread

"Data type mismatch in criteria expression" from C# app in French

 
 
=?Utf-8?B?R3JlZw==?=
Guest
Posts: n/a
 
      30th Jan 2005
Hi,

I get a "Data type mismatch in criteria expression" error when attempting to
write to an Access database in my C#.NET Windows Forms application. This
only occurs when the OS regional settings are set to French. When they are
set to English, the write query works fine. I use System.Data.OleDb.

The parameter types are set to DbType.Guid, DbType.String, and
DbType.Decimal where applicable. There are NO dates.

This is the query that is executed:

PARAMETERS [@AdvisorID] Guid, [@UserID] Text ( 255 ), [@UserPassword] Text (
50 ), [@URL] Text ( 255 ), [@Logo] Text ( 255 ), [@UICulture] Text ( 255 ),
[@OutputCulture] Text ( 255 ), [@CapitalGainsInclusionRate] IEEEDouble,
[@DefaultTaxRate] IEEEDouble, [@PrintSummaryDefault] Text ( 9 ),
[@FullStandardDefault] Text ( 9 ), [@DefaultCorpTaxRate] IEEEDouble,
[@DefaultCapitalTaxRate] IEEEDouble, [@DefaultAIRateSpread] IEEEDouble,
[@DefaultAUInterestPct] IEEEDouble, [@DefaultAIDividendPct] IEEEDouble,
[@DefaultAICGPortion] IEEEDouble, [@DefaultAIUCGPortion] IEEEDouble;
INSERT INTO Advisor ( AdvisorID, UserID, UserPassword, URL, Logo, UICulture,
OutputCulture, CapitalGainsInclusionRate, DefaultTaxRate,
PrintSummaryDefault, FullStandardDefault, DefaultCorpTaxRate,
DefaultCapitalTaxRate, DefaultAIRateSpread, DefaultAIInterestPortion,
DefaultAIDividendPortion, DefaultAICGPortion, DefaultAIUCGPortion )
SELECT [@AdvisorID] AS Expr1, [@UserID] AS Expr2, [@UserPassword] AS Expr3,
[@URL] AS Expr5, [@Logo] AS Expr6, [@UICulture] AS Expr7, [@OutputCulture] AS
Expr8, [@CapitalGainsInclusionRate] AS Expr9, [@DefaultTaxRate] AS Expr10,
[@PrintSummaryDefault] AS Expr11, [@FullStandardDefault] AS Expr12,
[@DefaultCorpTaxRate] AS Expr13, [@DefaultCapitalTaxRate] AS Expr14,
[@DefaultAIRateSpread] AS Expr15, [@DefaultAUInterestPct] AS Expr16,
[@DefaultAIDividendPct] AS Expr17, [@DefaultAICGPortion] AS Expr18,
[@DefaultAIUCGPortion] AS Expr19;


I can't for the life of me figure out why it would work under English
regional settings but not French. I assume something related to formatting
is occurring, but I don't know why. Does anyone have any ideas?

Thanks

Greg
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      31st Jan 2005
Greg,

You know that OleDb does not use the names of the parameters however the
sequence of existence.

Cor


 
Reply With Quote
 
=?Utf-8?B?R3JlZw==?=
Guest
Posts: n/a
 
      31st Jan 2005
Yes, I do that as a form of documentation. The fields are added in the same
order they are expected by the query in Access.

"Cor Ligthert" wrote:

> Greg,
>
> You know that OleDb does not use the names of the parameters however the
> sequence of existence.
>
> Cor
>
>
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      31st Jan 2005
Greg,

Not that I see directly something, sounds strange for me as well, however
just guessing, do you use in the French culture maybe more extended
characters?

Cor


 
Reply With Quote
 
=?Utf-8?B?R3JlZw==?=
Guest
Posts: n/a
 
      31st Jan 2005
No - exactly the same set as with English. I suspect it probably has
something to do with the decimal fields and that perhaps the OleDb code
somehow converts them to string before sending them over to the Jet engine.
For all I know, maybe a SQL statement is created first. I know that Access
will only accept US formatting for dates. If it is in fact doing a
conversion to text, then I am at a loss as to what to do.

"Cor Ligthert" wrote:

> Greg,
>
> Not that I see directly something, sounds strange for me as well, however
> just guessing, do you use in the French culture maybe more extended
> characters?
>
> Cor
>
>
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      1st Feb 2005
Greg,

When what you write is true than should be the major part of the world be in
trouble. Only the US, English speaking Candada and the ones who use the
dates in a Coca Cola cultures use the US style of dates.

As well is in most not English language parts of the world standard to use a
comma as decimal point.

AFAIK are the datetimes in Access the same as in SQL server written in
ticks.

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
query error "Data type mismatch in criteria expression" on sum Igor Barbaric Microsoft Access 2 27th Jan 2006 12:23 PM
Mysterious "Data type mismatch in criteria expression" error =?Utf-8?B?TWljaGFlbCBTdXR0a3VzLCBJSQ==?= Microsoft Access Queries 8 10th Nov 2005 05:57 PM
Mysterious "Data type mismatch in criteria expression" error =?Utf-8?B?TWljaGFlbCBTdXR0a3VzLCBJSQ==?= Microsoft Access VBA Modules 8 10th Nov 2005 05:57 PM
In query, getting "Data type mismatch in criteria expression" mess =?Utf-8?B?anNjY29ycHM=?= Microsoft Access Queries 2 14th Dec 2004 11:16 PM
"Data Type Mismatch In Criteria Expression" Error =?Utf-8?B?TEI=?= Microsoft Access Queries 1 9th Nov 2004 03:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:29 AM.