Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combobox changes the decimal commas to dots - How to prevent it? | Excel Discussion (Misc queries) | |||
Change dots to commas!! | Excel Discussion (Misc queries) | |||
how do u set up multiple choice answer buttons/dots? | Excel Worksheet Functions | |||
Replacing dots with commas using macro | Excel Programming | |||
Change Dots into Commas as Decimal Divider | Excel Discussion (Misc queries) |