ADODB Parameters: work independent from regional formats
Hi,
I'm using an ADODB.Command object and it's Parameters property to insert records into an Access database ("insert into table (...) values (...)"). One of the table fields is of type Currency. The corresponding ADODB.Parameter.Type is DataTypeEnum.adCurrency.
The advantage of using parameters is that we don't have to care about regional settings (number and date formats). However, in this case, I get wrong values in the table.
Dim hours As Currency
'...
cmd.Parameters.Item(8).Value = hours 'hours is 123.45
'...
cmd.Execute
Result: The field contains 12345. I expect 123.45.
The same issue with dates: Our (german) regional format ist dd.MM.yyyy. If the parameter value is 2/1/2024 (first of February), the table contains the value 1/2/2024 (second of January).
Question: Why?? Can I change this behavior? Is my assumption wrong, that the behavior is independent from regional settings? Obviously it's not. This is new to me.
(unfortunatelly I found none of the tags like ADODB, database programming (in general), VBA, Jet Engine, oledb)