Replicating the SQL Server dictionary sort in Visual Basic 
Author Message
 Replicating the SQL Server dictionary sort in Visual Basic

Hi All,

I have a VB application which uses a SQL Server database to store
different
sets of data. The sort order is set to dictionary sort which is as
follows:

Sort Order Description
------------------------------------------------------------------------------------------------------------------------------------
Character Set = 1, iso_1
    ISO 8859-1 (Latin-1) - Western European 8-bit character set.
Sort Order = 52, nocase_iso
    Case-insensitive dictionary sort order for use with several We
    stern-European languages including English, French, and German
    .  Uses the ISO 8859-1 character set.

I store the data returned from the database in an array and I perform
a binary sort on the array. The problem is that when comparing a
string
with the values stored in the array an incorrect result is returned
because
of the comparison done by VB.

e.g. The following is a subset of the array:

USD=
USD1YZ=R
USD4.5
USD6MZ=R

By doing the following comparison in VB, false is returned when true
is
expected.

USD= < USD1YZ=R

I have used the StrConv() function but this did not yield the correct
result.

I was hoping to find a way of accomplishing this without resorting to
storing the character order defined by SQL Server for the dictionary
sort
and doing a character-by-character comparison but I fear that this may
be the only way.

Any further insight greatly appreciated.

Thanks,
mikey.



Wed, 14 Dec 2005 01:10:50 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Import text file in SQL Server 6.5 via SQL in Visual Basic

2. Application Development: MS-Access, Visual Basic, SQL Server, SQL Anywhere

3. BUG: Visual Basic 6.0 T-SQL Debugger Fails Against SQL Server 2000 Named Instance (Q310647)

4. Import text file in SQL Server 6.5 via SQL in Visual Basic

5. Visual basic programs - connect to a server - Visual Basic 5 Enterprice Edition

6. copy data between sql servers using ADO VB visual basic

7. sql-server access via visual basic

8. Problem with Visual Basic / SQL Server

9. VISUAL BASIC/SQL SERVER DEVELOPERS NEEDED

10. SQL-Server / Visual Basic connections problem

11. Getting SQL SERVER Stored Procedure results from Visual Basic

12. Visual Basic 6 and SQL Server Connections(ADO)

 

 
Powered by phpBB® Forum Software