Different Locale

Different Locale

Post by AT » Wed, 19 Mar 2003 08:34:30



Hi
I have SQL Server Database configured for Greek.
Table1 has Column1 type varchar(50)
Some string is stored in Greek Code Page
Example first 3 bytes are
200
201
202

I run this from computer with English United States Regional Setting from
VB6

Const conn = "Provider=SQLOLEDB.1;Persist Security Info=False;Network
Library=dbmssocn;Data Source=DevSrv1\A;Initial
Catalog=EvanGreekTestG_DTA;User ID=sa;Password=mypassword"
Dim cmd As New ADODB.Command, Rs As ADODB.Recordset
Dim i As Integer
With cmd
    .ActiveConnection = conn
    .CommandType = adCmdText
    .CommandText = "select Column1 from Table1 where UniqueID = 1"
    Set Rs = .Execute
End With
Debug.Print Rs.Fields(0).Value

And getting some garbage in the result.
I'd expect the worst case scenario of results as bytes sequence
200
0
201
0
202
0
Since Strings in VB are Unicode 2 bytes.
Instead I get something like
54
0
55
0
56
0
I do not understand where 54 came from.

How to tell SQL Server 2000 in connection string or anywhere else that I
need result converted to Unicode using Greek
or at least get some reasonable result.

Any idea is appreciated.

Regards.

_________________________
Anatoli Trifonov
Software Developer & Consultant
Minds are like parachutes - they only function when open.
--Thomas Dewar

 
 
 

1. Urgent - Backup/restore using different locale id

I've backed up a database under Unicode comparison style 196611 and after
reinstalling the server from scratch, I get and when restoring the database
that the actual Unicode comparison style is 196609. Could someone tell me
what locale id does Unicode comparison style 196611 refer in Setup so that I
can restore my databases. Thanks in advance...

2. NMIUA Meeting December 7th (Albuquerque, NM)

3. MDAC woes

4. Multilingual application, ORDER BY w/ different locales?

5. IBM VisualAge with Sql Server?

6. Different Locales

7. Problem with Triggers not returning Raise Error

8. Create synonym od database with different locale?

9. synonym and different locale

10. Different locales

11. DTS date handling on different system locales

12. Locale and C Locale