views:

419

answers:

2

I want to import data from a DB2 database into MS Access via ODBC. The connection is set up and working but decimal values get converted due to some locale issue (German Windows).

234.75 ends up as 23475 in the Access table.

I had the same issue with Oracle but was able to fix it by setting the ODBC drive to US locale. How can I do that with the DB2 ODBC driver?

DB2 v9.5

+2  A: 

Do you have the possibility to read some of your field's properties through your ODBC connection? In this case I guess you could find that some of these properties will help you identify field's type, default value, length, etc. It should be then possible for you to incorporate in your import code some conversion instructions for numbers.

Have you tried to change your windows locale settings to US (start/Settings/Control Panel/Regional and language Settings/Regional Settings/customize)?

Even if your windows is german, you can set things such as decimal separator, date, etc to other standards (meaning for example that you can specificaly declare '.' as decimal separator instead of ',' for all windows applications.

Philippe Grondier
Yes I tried changing the regional settings but this didn't help. The Access import function doesn't offer any customizations but in doing it manually with VBA I might have a chance to incorporate your advice on field types.
OliverS
+2  A: 

When you set an ODBC connection with the linked table manager and you click through all the screens about database name, what credentials to use, there is a checkbox there for "Use regional settings when outputting dates, times, etc... something like that..." Is that checked?

Dale Halliwell
I am using Access 2007 the linked table manager doesn't offer any regional settings dialogs.
OliverS