INTERNATINAL SETTINGS PROBLEM WITH SQL SERVER 6.5 ......PLEASE HELP 
Author Message
 INTERNATINAL SETTINGS PROBLEM WITH SQL SERVER 6.5 ......PLEASE HELP

Dear colleagues fellow programmers,

I am making a project for a German Company using a German MS SQL Server 6.5
running on a German WinNT with German country settings.  My clients, where
we program and test are all US English settings (Win 98).

The scenario is this: When we set the clients to US English which uses a
point . as decimal divider then the data are entered into the SQL server
without problems (even though the server is German???).  When we set the
country settings to German (Standard) then it crashes because here the
decimal divider is , comma.  Comma is also the field divider in the SQL
statement.

The funny part is that if we format the value to be entered in the server
like this:

strMarkup = Format(Me.txtField(8).Text, "###,###,##0.00")    Formatting the
number to use . as decimal divider
mMarkUp = CSng(strMarkup)  Convert value to a single (as on the server)

thus making mMarkUp the value to enter into the server then a , (comma) is
still used as decimal divider and not the . (dot) as would be expected.

Then is something here we dont understand..

Im sure that there is a logical explanation for that and I would highly
appreciate if somebody could send me a short mail explaining why, and maybe
how to get around it.

Please send the mail to this news group for everyone to share along with a

Hope to hear from a knowledgeable colleague soon,



Tue, 10 Jul 2001 03:00:00 GMT  
 INTERNATINAL SETTINGS PROBLEM WITH SQL SERVER 6.5 ......PLEASE HELP
Peter,

The Format function does NOT change the decimal separator for you. All it
does is read the locale settings to format the output. The format you
specify in code however, must be the "US-way". This means that a decimal
separator must ALWAYS be indicated as a comma. I had some brilliant
conversion routine at some stage, but I can't find it right now. But what I
can give is this:

' Get the text form the text box
strMarkup = Me.txtField(8).Text
' Replace the comma with a period
   Mid$(strMarkup, InStr(1, strMarkup, ","), 1) = "."
' Use Val instead of CSng because CSng is also aware of the locale settings
mMarkUp = Val(strMarkup)

--
HTH
VB-Joker

PLEASE post ALL replies to newsgroup!


Quote:
>Dear colleagues fellow programmers,

>I am making a project for a German Company using a German MS SQL Server 6.5
>running on a German WinNT with German country settings.  My clients, where
>we program and test are all US English settings (Win 98).

>The scenario is this: When we set the clients to US English which uses a
>point "." as decimal divider then the data are entered into the SQL server
>without problems (even though the server is German???).  When we set the
>country settings to German (Standard) then it crashes because here the
>decimal divider is "," comma.  Comma is also the field divider in the SQL
>statement.

>The funny part is that if we format the value to be entered in the server
>like this:

>strMarkup = Format(Me.txtField(8).Text, "###,###,##0.00")    'Formatting
the
>number to use "." as decimal divider
>mMarkUp = CSng(strMarkup)  'Convert value to a single (as on the server)

>thus making mMarkUp the value to enter into the server then a "," (comma)
is
>still used as decimal divider and not the "." (dot) as would be expected.

>Then is something here we don't understand...

>I'm sure that there is a logical explanation for that and I would highly
>appreciate if somebody could send me a short mail explaining why, and maybe
>how to get around it.

>Please send the mail to this news group for everyone to share along with a

>Hope to hear from a knowledgeable colleague soon,



Tue, 10 Jul 2001 03:00:00 GMT  
 INTERNATINAL SETTINGS PROBLEM WITH SQL SERVER 6.5 ......PLEASE HELP
Hallo Peter,

try the following 2 Lines with German settings:

    debug.print Str$(15.35)
    debug.print Format$(15.35)

Have you seen the small difference?


http://home.t-online.de/home/goetz-software
(with Tips + SampleCode for VisualBasic)



Wed, 11 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. INTERNATINAL SETTINGS PROBLEM WITH SQL SERVER 6.5 ......PLEASE HELP

2. INTERNATINAL SETTINGS PROBLEM WITH SQL SERVER 6.5 ......PLEASE HELP

3. Please advice in learning sql server 6.5

4. Problem With Inserting Over 1200o records into SQL server 6.5

5. DAO, RAD Problems with the SQL 6.5 Server

6. @@IDENTITY problem with VB432/SQL Server 6.5

7. Dynaset/Snapshot problem using SQL Server 6.5

8. Problems with VB4.0 and MS SQL Server 6.5

9. Visual Basic RDO and SQL Server 6.5 null Problem

10. Problems with ODBC drivers for SQL Server 6.5

11. ODBC and SQL Server 6.5 problem.

12. SQL Server 6.5 Evaluation Problem

 

 
Powered by phpBB® Forum Software