Home > Archive > SQL Anywhere database > June 2005 > ADO/ODBC/Unicode Problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ADO/ODBC/Unicode Problem
Martin

2005-06-24, 9:23 am

We're trying to do a russian localization of our database application.

The application is written in Visual Basic 6 and uses mdac (ADO) and
ODBC to access the ASA 7 database.

In the following examples sName is assinged a bunch of cyrillic
characters, a russian name, for example.

That does work [1]:
Dim sSQL As String, rs As ADODB.Recordset
sSQL = "SELECT p_name FROM persons WHERE (id = 397) "
Set rs = New ADODB.Recordset
rs.Open sSQL, CnData, adOpenDynamic, adLockOptimistic
rs!p_name = sName
rs.Update
rs.Close: Set rs = Nothing

That doesn't work [2]:
Dim sSQL As String
sSQL = "UPDATE persons SET p_name = '" & sName & "' " & _
"WHERE (id = 397) "
CnData.Execute sSQL

The command in sample [2] is executed, but instead of the cyrillic
characters only a bunch of '?' are written to the database! Somewhere on
its way ADO -> ODBC -> ASA7 the cyrillic characters are 'translated'.

Did anybody experience this problem, too? Does anybody have a hint on
how to solve this?

Thansk in advance!

Martin Sperlich



Andrei Iliev

2005-06-24, 9:23 am

Check database collation ( run select * from sysinfo). It should be
1251Cyr. What OS is installed on the server?
In case of Win2000/2003 - check Your locale (see setting in Control
Panel/Regional Options/General), try use Russian locale. Check input
locales, add Russian if you don't have added it before.

--
Andrei Iliev

"Martin" <martin.sperlich@gmail.com> wrote in message
news:42bc0b61$1@foru
ms-2-dub...
> We're trying to do a russian localization of our database application.
>
> The application is written in Visual Basic 6 and uses mdac (ADO) and
> ODBC to access the ASA 7 database.
>
> In the following examples sName is assinged a bunch of cyrillic
> characters, a russian name, for example.
>
> That does work [1]:
> Dim sSQL As String, rs As ADODB.Recordset
> sSQL = "SELECT p_name FROM persons WHERE (id = 397) "
> Set rs = New ADODB.Recordset
> rs.Open sSQL, CnData, adOpenDynamic, adLockOptimistic
> rs!p_name = sName
> rs.Update
> rs.Close: Set rs = Nothing
>
> That doesn't work [2]:
> Dim sSQL As String
> sSQL = "UPDATE persons SET p_name = '" & sName & "' " & _
> "WHERE (id = 397) "
> CnData.Execute sSQL
>
> The command in sample [2] is executed, but instead of the cyrillic
> characters only a bunch of '?' are written to the database! Somewhere on
> its way ADO -> ODBC -> ASA7 the cyrillic characters are 'translated'.
>
> Did anybody experience this problem, too? Does anybody have a hint on
> how to solve this?
>
> Thansk in advance!
>
> Martin Sperlich
>
>
>



Martin

2005-06-27, 7:23 am

Hi Andrei,

thanks a lot - I changed the collation to 1251CYR and now it works :-D

Best Wishes
Martin

Andrei Iliev wrote:
> Check database collation ( run select * from sysinfo). It should be
> 1251Cyr. What OS is installed on the server?
> In case of Win2000/2003 - check Your locale (see setting in Control
> Panel/Regional Options/General), try use Russian locale. Check input
> locales, add Russian if you don't have added it before.
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com