Regional Setting may affect in query statement

  • Thread starter Thread starter Yanto
  • Start date Start date
Y

Yanto

Hi,

Is there anybody know how to fix this problem? I use query statement like
this:
SQLtext="INSERT INTO payroll (Emp_id, TotWorkingHour) VALUES (" & strEmp_ID
& "," & numTotWorkingHour & ");"
In client computer, they are using Regional setting (Indonesian), this
setting will effect in currency format like this "2,2" (in Indonesian
format). So when I execute the above query, the error will arise because the
number of values seems not same with the number of fields. I have tried to
use Format function ( as we use to reformat the date when deal with the
regional issue) but still error. This error will happen if for example
numTotWorkingHour = 1.4 (one point four)
Please give any comment.
TIA

Yanto
 
This is just a guess, I'm not currently set up with languages besides
english,
but it might work if you use conversion functions in your SQL as follows
(i.e. CCur(), CDbl()):

SQLtext="INSERT INTO payroll (Emp_id, TotWorkingHour) VALUES (" & strEmp_ID
& ",CDbl('" & numTotWorkingHour & "'));"
Since numTotWorkingHour is a fractional value (not really a currency though,
right? If it were a true currency field, you could use CCur instead)

Hope this works, but if not please feel free to post back and maybe someone
else can help out.
 
Back
Top