Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

decimal point problem

Status
Not open for further replies.

Manderby

Programmer
Sep 14, 2004
5
CH
Hi all,

I'm sitting here for some hours already and I need your professional help. I did implement a conversion-tool for oracle to access. The Problem is, that this Program is for someone in Danemark, so this normally is nothing to worry about, but now, Access starts to destroy my patience.

Everytime I do insert some values with an SQLExecuteDirect, Access deletes the decimal point. The thing I'm worring about is, that the decimal value isn't cutted off, as for example 1234.5678 becomes 1234 but the points is just deleted, so the value becomes 12345678 !

These are the facts:
w2000
office2000
oracle9i

This problem exists only if I do change the local settings in my Computer to Danemark (which will be the normal case where my program will have to work!). So, the problem is obviously the decimal point, which -normally in danemark- is a Comma (,) . So I guess, the ODBC-driver uses this comma like the thousand-dot which is used in english punctiation.

As fas as good: I have found the problem, but...!

For SQL I NEED the "normal" punctuation with dot (.). Everything else gives me back an error. Even if i put the value into a string (example '12.34').

I already tried to change these settings with setlocale() but nothing happends, the values are still wrong.

For Oracle, I found an SQL-Statement which turns the local settings to normal for the actual session:

alter session set NLS_NUMERIC_CHARACTERS='.,'

This works fine, even if the local settings are set to Danemark. But Access does not understands this statement. And other ODBC-drivers will not too, I'm sure. So it looks a little ugly if there are thousands of errors occuring.

Is there a similar statement for access or for EVERY known ODBC-DBS?
How could I solve this problem?

Thank you in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top