Question

Czech letters missing SQL & Windows collation

Asked by: DennisPost

Hi,

I have a vb6 app that will be used in the Czech Republic .
I can type in Czech but the data saved is missing some characters.

I have 2 database fields for testing. One has collation SQL_Czech_CP1250_CI_AS
and the other Czech_BIN. Both do not save all the characters.

The server and database default collations are SQL_Latin1_General_CP1_CI_AS.
The database server is using english regional settings.

How can I enter all the czech characters?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-09-24 at 08:07:13ID22848470
Tags

czech

,

sql

,

sql_latin1_general_cp1_ci_as

Topic

MS SQL Server

Participating Experts
6
Points
500
Comments
36

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. change Collation
    Hello how can i change the collation name of a specific database ? The rebuildm.exe is changin the Master database while i want to change only a specific database . is there a way to change it with sql statements like alter ? What is the common collation name ? (I develo...
  2. Collate
    I've been seeing errors like this recently in my work: Cannot resolve collation conflict for equal to operation. I've fixed my problems by designing queries in Design View of views then examining the resulting SQL and things like the following have been appearing. COLLATE ...
  3. collation
    How do I stop the "latin1_swedish ci collation" going into my tables when I load my sql files into phpmyadmin? I don't have it set in any of my sql files. I have apache/mysql/php/perl/phpmyadmin set up on my windows xp computer there must be a delfault stting some ...
  4. Collation setting
    We are running sql 2005 (cluster). I notied that our dev servers collation is set to LATIN1_GENERAL_CI_AI, but production is set to SQL_LATIN1_GENERAL_SP1_CI_AS. For what I could find: latin1_general = U.S english... CI_AI: case-insensitive, accent insensitive, kana in...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: crosan1cPosted on 2007-09-24 at 09:21:20ID: 19949472

What datatype are the fields you are referencing?  I haven't had to work with either of the Czech collations before, but if size of the table isn't a huge issue you may try using nvarchar if you happen to be using varchar currently.

 

by: DennisPostPosted on 2007-09-25 at 00:44:35ID: 19953997

Hi,

I was indeed using just varchar fields. Changing them to nVarchar did not help. I am still not able to save
some of the letters.
Do you think the regional settings might have anything to do with it?

 

by: harris_cPosted on 2007-09-25 at 01:59:56ID: 19954213

http://msdn2.microsoft.com/en-us/library/aa902644(sql.80).aspx

ALTER DATABASE Products
COLLATE Czech_CI_AI

 

by: harris_cPosted on 2007-09-25 at 02:01:15ID: 19954220

Oops its further down....

CREATE TABLE jobs
(
   job_id  smallint
      IDENTITY(1,1)
      PRIMARY KEY CLUSTERED,
   job_desc varchar(50)
      COLLATE Czech_CI_AI
      NOT NULL
      DEFAULT 'New Position - title not formalized yet',
)

 

by: harris_cPosted on 2007-09-25 at 02:02:43ID: 19954227

Another thing...  VB6 may or may not be Unicode aware:

http://www.vbforums.com/showthread.php?t=365738

 

by: DennisPostPosted on 2007-09-26 at 02:29:43ID: 19961588

I altered all the regional setting on my server in Czech to Czech including default non-unicode language.
I can type but cannot save 4 letters still.
I have been trying different collations without success.

Good anymore tricks?

 

by: harris_cPosted on 2007-09-26 at 02:34:11ID: 19961605

There is one more thing that you can do...

Convert your data to UTF-8 or plain text...  you should have those weird \x?? equivalents of your czech specific strings then save it.

You can convert it back for user display.

This is if all fails.

hec",)

 

by: DennisPostPosted on 2007-09-26 at 02:56:27ID: 19961685

Not really sure what you mean. How can I convert my strings like that and how can I see the results?

I was thinking..... could this have anything to do with an ADO issue?

 

by: DennisPostPosted on 2007-09-26 at 03:40:23ID: 19961859

TJust to let you know which letters I am missing look at this link:
http://www.science.co.il/Language/Character-Code.asp?s=1250

Decimals: 200, 204, 216 & 217

 

by: harris_cPosted on 2007-09-26 at 19:55:21ID: 19968444

ADO command object type parameter should be adVarWChar (unicode string null terminated).

 

by: DennisPostPosted on 2007-09-27 at 02:27:44ID: 19969773

Yer getting a little too technical on me the harris.
Could you please break that down into laymans terms for me.

Cheers

 

by: harris_cPosted on 2007-09-27 at 02:57:33ID: 19969880

Can you post your VB code here.

 

by: DennisPostPosted on 2007-09-28 at 02:45:30ID: 19977411

Which code are you refering to? The update statement?
If so, there's a problem with that, namely the characters cannot be used here.
Still want it?

 

by: jaiganeshsrinivasanPosted on 2007-09-28 at 03:04:31ID: 19977479

This is what is called as "Internationlization using VB"(google for it to learn more)...its a bit of a clumpsy thing. We have once tried to do internationlization with Collations...but there seemed to be problem with VB and not with SQL...if you use your query analyzer and try to insert with any collation it will accept but not with VB...
so after many thoughts we used some unicode third party controls that are available in the market. I can suggest you to use them, but it nearly took a month for us to do the convertion...but the results were promising.

this was some years ago(we are in .net now and no third part controls)...iam not sure wht is up in the market for VB anymore...

 

by: angelIIIPosted on 2007-09-28 at 03:30:45ID: 19977558

>Which code are you refering to? The update statement?
yes, the SQL code you use, as well as the part of the vb code you use to run the sql statement

 

by: MrRobotPosted on 2007-09-28 at 03:49:59ID: 19977623

Hey Dennis,

Are you checked if the characters aren't updated or they are just problematic to pull / display ?

Eg. What is saved instead of that characters, it's a low possibility for the sql server to just pass them. Have you tried to get the length like
select len(myField) from myTable where ID = xx
does it show the length of the string without counting the missing characters?

if they seem to be there, can you try something like
select ascii(substring(myField,characterLocationInTheString,1)) from myTable where ID = xx
and see if the character code you get is right?

 

by: MrRobotPosted on 2007-09-28 at 03:55:37ID: 19977642

btw, try not to use column collations and use db collation for the production db.

 

by: MrRobotPosted on 2007-09-28 at 04:14:23ID: 19977714

try these from query analyzer,


declare @myString varchar(50)
set @myString = char(200) -- your problematic character
select @myString, ascii(@myString)
update myTable set myField = @myString where ID = xx
select myField, len(myField), ascii(myField) from myTable where ID = xx


and


declare @myString varchar(50)
set @myString = 'A' -- your problematic character
select @myString, ascii(@myString)
update myTable set myField = @myString where ID = xx
select myField, len(myField), ascii(myField) from myTable where ID = xx

 

by: DennisPostPosted on 2007-09-28 at 04:33:38ID: 19977802

jaiganeshsrinivasan:
I have been asured that Czech is a non-unicode language, and want to avoid months of reprogramming as I only have a couple of weeks to get this up and running.

Harris / Angellll (Thanks for taking a look AngelIII !!)
Here is the code.

Public Function OpenADOcnn() As Boolean
Dim sConnStr As String
    Set AdoConn = New ADODB.Connection
    On Error GoTo errorhandler
    With AdoConn      
        sConnStr = "Provider=" & Trim(gsProvider) & "" & ";" & "Data Source=" & Trim(gsDataSource) & ""   & ";" & "OLE DB Services= -2;uid=TestDB;pwd=12345;Initial Catalog=" & Trim(gsCatalog) & "" & ";"
        .ConnectionString = sConnStr
        .Open
    End With
    AdoConn.Execute "SP_SetAppRole 'TraxIT', {ENCRYPT N '12345'}, 'odbc'"
    OpenADOcnn = True
    intConns = intConns + 1
    Exit Function
errorhandler:
    OpenADOcnn = False
    errorM "OpenADOcnn"
End Function

Private Sub UpdateCustomer()
On Error GoTo errorhandler

    OpenADOcnn
    SQLExec = "UPDATE tblCust SET " & _
              " Naam = " & SQLQuote(Me.txtNaam) & ", " & _
              " DebNr = " & Me.txtNRDebNr & ", " & _
              " CredNr = " & Me.txtNRCredNr & ", " & _
              " Straat = " & SQLQuote(Me.txtAdres) & ", " & _
              " Postcode = " & SQLQuote(Me.txtPC) & ", " & _
              " Plaats = " & SQLQuote(Me.txtPlaats) & ", " & _
              " Land= " & glLandID & ", " & _
              " Telefoonnummer = " & SQLQuote(Me.txtTelefoon) & ", " & _
              " Faxnummer = " & SQLQuote(Me.txtFax) & ", " & _
              " Email = " & SQLQuote(Me.txtEMail) & ", " & _
              " Website = " & SQLQuote(Me.txtWeb) & ", " & _
              " PBPostbus = " & Trim(SQLQuote(Me.txtPBPB)) & ", " & _
              " PBPostcode = " & SQLQuote(Me.txtPBPC) & ", " & _
              " PBPlaats = " & SQLQuote(Me.txtPBPLaats) & ", " & _
              " PBLand = " & glPBLandID & ", " & _
              " BankNaam = " & SQLQuote(Me.txtBanknaam) & ", " & _
              " BankAdres = " & SQLQuote(Me.txtBankadres) & ", " & _
              " BankPlaats = " & SQLQuote(Me.txtBankplaats) & ", " & _
              " RekeningNr = " & SQLQuote(Me.txtRekNr) & ", " & _
              " IBAN = " & SQLQuote(Me.txtIBAN) & ", " & _
              " BIC = " & SQLQuote(Me.txtBIC) & ", " & _
              " Opmerkingen = " & SQLQuote(Me.txtOpm) & ", " & _
              " BTWNR = " & SQLQuote(Me.txtBTWNr) & " " & _
              " WHERE AdresID= " & Me.txtcustID
    AdoConn.Execute SQLExec

    AdoConn.Close
    Set AdoConn = Nothing
    Exit Sub
errorhandler:
    errore frmRelatieGegevens, "UpdateCustomer"
End Sub

Copying SQLExec to Query Analyzer shows all the correct charaters.
Running it in QA works but the results are missing the right accents.

 

by: JulianvaPosted on 2007-09-28 at 04:41:52ID: 19977839

You can try to change server level collation if you havnt done that already instead of database or column level collation. But to change server level collation now you would need to rebuild the master database.

SQL_Latin1_General_CP1_CI_AS. - this is US english

 

by: MrRobotPosted on 2007-09-28 at 04:48:47ID: 19977870

ah direct sql query...

you may want to try parametrized query, or better a stored procedure. that helps to package parameters better.

 

by: DennisPostPosted on 2007-09-28 at 04:55:16ID: 19977894

MrRobot,

>>Are you checked if the characters aren't updated or they are just problematic to pull / display ?
SEM / Open rows & QA both dispaly the letters incorrectly (Only the accents (caron & ring) are missing)

>>Eg. What is saved instead of that characters, it's a low possibility for the sql server to just pass them.
Sorry, I was unclear. The letters are there but are not the correct letters.

I am only using column colations at the moment. Will try changing the db collation as well.
brb on that one.....

>>set @myString = char(200) -- your problematic character
Not sure what u mean by this. (char(200)'A') ???

>>declare @myString varchar(50)
    set @myString = 'A' -- your problematic character
     select @myString, ascii(@myString)
     update myTable set myField = @myString where ID = xx
     select myField, len(myField), ascii(myField) from myTable where ID = xx

Displays the letter without the accent ring, len = 1
 e + caron = ascii 101
 c + caron = ascii 99
 r + caron = ascii 114
 u + ring = ascii 117

 

by: DennisPostPosted on 2007-09-28 at 05:06:13ID: 19977950

Just to let you know which letters I am missing look at this link:
http://www.science.co.il/Language/Character-Code.asp?s=1250

Decimals: 200, 204, 216 & 217

 

by: angelIIIPosted on 2007-09-28 at 05:18:29ID: 19978013

let me suggest this difference:
    set @myString = N'A' -- your problematic character
    select @myString, ascii(@myString)

now, what code page is your windows os installed?
the character might be stored correctly, but your os is not "capable" of displaying it correctly?

 

by: MrRobotPosted on 2007-09-28 at 05:24:09ID: 19978049

>> Not sure what u mean by this. (char(200)'A') ???

I mean the char codes, like char(200), char(204) to pass the string conversion in the compilation. But from your reply I guess that would give you the same results. It looks like it parses the input string using the right collation and converts it to latin collation, so I would try to change the db collation as the first step, column collations has some cons.


 

by: MrRobotPosted on 2007-09-28 at 05:26:04ID: 19978061

angelIII :

it seems like it's not about displaying the character, the returned ascii codes show the ascii value is not the right one.

 

by: DennisPostPosted on 2007-09-28 at 05:31:32ID: 19978089

>>btw, try not to use column collations and use db collation for the production db.
IT WORKED !!!
What's the point of using column collations, if you can't just change it and have it work?

 

by: MrRobotPosted on 2007-09-28 at 05:31:42ID: 19978091

btw,

create a new table after the db collation is changed, and try it on the new table.

 

by: MrRobotPosted on 2007-09-28 at 05:34:20ID: 19978110

nice to know it worked.

column collations are to hold data in that collation only, they can't handle most of the conversions, so you have to sort any issues.

 

by: MrRobotPosted on 2007-09-28 at 05:39:44ID: 19978139

eg. you can pass data between a unicode column and a column with a specific collation, but when passing data to the server your strings will be handled by the db collation.

 

by: DennisPostPosted on 2007-09-28 at 05:39:45ID: 19978140

>>column collations are to hold data in that collation only, they can't handle most of the conversions, so you have to sort any issues.
But it wasn't holding the right data. Missing 4 letters is a very major con don't you think.
What needs to be converted? ascii codes? Doesn't/shouldn't it just return the stored value?

 e + caron = ascii 236
 c + caron = ascii 232
 r + caron = ascii 248
 u + ring = ascii 249

 

by: MrRobotPosted on 2007-09-28 at 05:41:48ID: 19978147

right =) they were getting processed by the db collation first, so the column was unable to get the right data to store.

rob

 

by: DennisPostPosted on 2007-09-28 at 06:01:45ID: 19978285

Oh no, my boss wants me to go to Prague by car next week now !!  1000+km :-(
I'll postpone and fly :-)

Thanks Guys !!

(AngelIII, thanks again for your attention.)

 

by: angelIIIPosted on 2007-09-28 at 06:03:17ID: 19978301

good job, people !

 

by: angelIIIPosted on 2007-09-28 at 06:06:38ID: 19978333

ok, just to "laugh" at me, can you try this on a database that is NOT Czech_CI_AI collation (for example, the master db?)

declare @myString nvarchar(30)
set @myString = N'A' COLLATE Czech_CI_AI   -- your problematic character
select @myString, ascii(@myString)

what gives?

 

by: DennisPostPosted on 2007-09-28 at 06:53:39ID: 19978632

The letter is displayed correctly, but the ascii code is that of a plain 'ol boring e (101)

Would I be able to call data that is stored as e to a vb 6 textbox as  (e + caron) after is was saved e + caron?

declare @myString nvarchar(30)
set @myString = (SELECT convert(nvarchar(10),left(Naam,1)) from tblcust where adresid = 9057) COLLATE Czech_CI_AI
select @myString, ascii(@myString)

this only returned an E (not e + caron)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...