LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Nobody can answer! Problem with commas and dots

Hi

I have done vast research but i seem to get no working answer to my problem.

I have a code that sends data from excel sheet to database. It works
perfectly but the problem is values with commas and dots.

I have values like 1400,50 (EUROPEAN CHARSET)

Database reads values only like 1400.50 (US CHARSET)

I send the data with this code:

query = "INSERT INTO company (salary) SELECT " & CDbl(ActiveSheet.Cells(8, 5))

This makes the query look like:

"INSERT INTO company (salary) SELECT 1400,50"

I have set european regional setting in my control panel, SQL tries to read
the value as two values: 1400 and 50 (1400,50) - resulting into an error.

Salary is defined as double in the database.

I cannot simply make a script that changes all commas into dots, as there
can be values like 150.400,60 - i can never know where the comma is.

I can't ask all users to change their regional settings to US while using
the script, there are many users in many countries.

I cannot make the script change the whole system setting to US while the
script is run, as it would be too dangerous.

How can i make the visual basic understand that the value to be sent to the
SQL is 1400.50 and not 1400,50 ?

HELP!!!



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combobox changes the decimal commas to dots - How to prevent it? Erkka Excel Discussion (Misc queries) 2 February 23rd 07 08:20 AM
Change dots to commas!! Andreas Excel Discussion (Misc queries) 1 November 18th 06 12:55 AM
how do u set up multiple choice answer buttons/dots? pam123 Excel Worksheet Functions 1 March 1st 06 12:48 PM
Replacing dots with commas using macro maxest Excel Programming 3 January 6th 06 03:32 PM
Change Dots into Commas as Decimal Divider xenia Excel Discussion (Misc queries) 2 August 8th 05 09:48 AM


All times are GMT +1. The time now is 07:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"