View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.programming
Poppe Poppe is offline
external usenet poster
 
Posts: 16
Default Nobody can answer! Problem with commas and dots

NickH & PeterT:

Thanks for your replies.

My code attempts:

-------

Dim CC As Double
Dim Query As String

CC = ActiveSheet.Cells(8, 5)
CC = CDbl(ActiveSheet.Cells(8, 5).Value)

Query = "INSERT INTO salary (amount) SELECT " & CC
Query = "INSERT INTO salary (amount) SELECT " & ActiveSheet.Cells(8, 5).Value

connection.Execute "INSERT INTO salary (amount) SELECT " &
Format(ActiveSheet.Cells(8, 5), "0.00")

-------

All of the above result the value being sent as "5020,5".

I see the values by adding all of the variables into Watch.

Also trying to run the code result in error "Insert value list does not
match column list. Wrong number of values for insert" as it tries to insert
5020 and 5 as two values.

Excel doesn't send it in RAW mode like it should (5020d5), it always sends
comma.
Formatting the Cell into text/value/general - has no effect.

How to get the underlying value 5020d5 ? This is a mystery to me.

NickH i'll try your code suggestion next. I have to post this answer now as
it is getting too long.