msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ASP, VB, and MSSQL using UTF-16

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB General Discussions
Author Message
InvestorTrade



Joined: 26 Feb 2008
Posts: 2

PostPosted: Mon Feb 25, 2008 11:47 pm    Post subject: ASP, VB, and MSSQL using UTF-16 Reply with quote

When I POST using UTF-16 on the web using ASP and VBScriipt
(not .Net), to a MSSQL Server 2000, my data gets stored in weird
characters. My application is used worldwide (Chinese, Japanese,
German, Spanish...) all sharing the same database, but each location
stores their information using their own language. When I retrieve
the data on the Web, the characters look fine - but using SQL Query
Analyzer the characters are all mangled.

I also have an offline application (written in HTA, VBScript, and
Javascript) that allows my users to upload their data at a later point
via a CSV file created using UNICODE, which appears to store the data
properly under the MSSQL Server (I confirm this by using Query
Analyzer)

To make things worse, the Web application will display properly the
data that it stored with the POST, but the data that was uploaded
though the CSV file displays incorrectly ( '???' characters). The
effect appears to be reversed when I use MSSQL Query Analyzer to
inspect the data - all the data that was uploaded using the CSV file
appears correct, but all the POST data is mangled.

I've placed under all the Web Pages forms and POST action pages:



I've also made all my forms to have:


I'm using Chinese in conjunction with English to troubleshoot my
problem.

Archived from group: microsoft>public>vb>general>discussion
Back to top
View user's profile Send private message
Tony Proctor



Joined: 04 Oct 2007
Posts: 1051

PostPosted: Wed Feb 27, 2008 2:12 am    Post subject: Re: ASP, VB, and MSSQL using UTF-16 Reply with quote

If these different locales are all sharing the same tables, make sure you
only use Unicode columns (i.e. types such as nchar, nvarchar, and ntext).
The normal char/varchar/text columns store ANSI text and so the
interpretation of their content is locale-dependent.

Tony Proctor

"InvestorTrade" wrote in message @d5g2000hsc.googlegroups.com...
> When I POST using UTF-16 on the web using ASP and VBScriipt
> (not .Net), to a MSSQL Server 2000, my data gets stored in weird
> characters. My application is used worldwide (Chinese, Japanese,
> German, Spanish...) all sharing the same database, but each location
> stores their information using their own language. When I retrieve
> the data on the Web, the characters look fine - but using SQL Query
> Analyzer the characters are all mangled.
>
> I also have an offline application (written in HTA, VBScript, and
> Javascript) that allows my users to upload their data at a later point
> via a CSV file created using UNICODE, which appears to store the data
> properly under the MSSQL Server (I confirm this by using Query
> Analyzer)
>
> To make things worse, the Web application will display properly the
> data that it stored with the POST, but the data that was uploaded
> though the CSV file displays incorrectly ( '???' characters). The
> effect appears to be reversed when I use MSSQL Query Analyzer to
> inspect the data - all the data that was uploaded using the CSV file
> appears correct, but all the POST data is mangled.
>
> I've placed under all the Web Pages forms and POST action pages:
>
>
>
> I've also made all my forms to have:
>
>
> I'm using Chinese in conjunction with English to troubleshoot my
> problem.
>
Back to top
View user's profile Send private message
InvestorTrade



Joined: 26 Feb 2008
Posts: 2

PostPosted: Tue Feb 26, 2008 11:05 pm    Post subject: Re: ASP, VB, and MSSQL using UTF-16 Reply with quote

All the necessary columns are defined in either nchar or nvarchar - as
said previously - when using my offline app, I can store the chinese
characters without a problem - viewing them using "SQL Query Analyzer"
displays the characters right, but using the browser it shows all
mangled. And when I use the browser to store the characters (looking
right through the browser), they appear all mangled under SQL Query
Analyzer.


Offline App => Creates CSV in UNICODE => ASP and VB uploads the CSV
into MSSQL => SQL Query Analyzer ==> Characters look fine
Offline App => Creates CSV in UNICODE => ASP and VB uploads the CSV
into MSSQL => Use Browser to retrieve the data ==> Characters look
mangled

Browser App => Form (UTF-Cool that accepts Chinese characters
(characters look fine on the form) => ASP and VB (different than
before) saves the data into MSSQL => SQL Query Analyzer ==> Characters
are mangled.
Browser App => Form (UTF-Cool that accepts Chinese characters
(characters look fine on the form) => ASP and VB (different than
before) saves the data into MSSQL => Browser to retrieve the just
insterted data ==> Characters are mangled.

Any ideas?
Back to top
View user's profile Send private message
Tony Proctor



Joined: 04 Oct 2007
Posts: 1051

PostPosted: Wed Feb 27, 2008 4:15 pm    Post subject: Re: ASP, VB, and MSSQL using UTF-16 Reply with quote

>> as said previously

You don't mention what column types you're using at all, which is why I
brought up the subject - just in case

Tony Proctor

"InvestorTrade" wrote in message @64g2000hsw.googlegroups.com...
> All the necessary columns are defined in either nchar or nvarchar - as
> said previously - when using my offline app, I can store the chinese
> characters without a problem - viewing them using "SQL Query Analyzer"
> displays the characters right, but using the browser it shows all
> mangled. And when I use the browser to store the characters (looking
> right through the browser), they appear all mangled under SQL Query
> Analyzer.
>
>
> Offline App => Creates CSV in UNICODE => ASP and VB uploads the CSV
> into MSSQL => SQL Query Analyzer ==> Characters look fine
> Offline App => Creates CSV in UNICODE => ASP and VB uploads the CSV
> into MSSQL => Use Browser to retrieve the data ==> Characters look
> mangled
>
> Browser App => Form (UTF-Cool that accepts Chinese characters
> (characters look fine on the form) => ASP and VB (different than
> before) saves the data into MSSQL => SQL Query Analyzer ==> Characters
> are mangled.
> Browser App => Form (UTF-Cool that accepts Chinese characters
> (characters look fine on the form) => ASP and VB (different than
> before) saves the data into MSSQL => Browser to retrieve the just
> insterted data ==> Characters are mangled.
>
> Any ideas?

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Close all MSSQL connections My VB6 application opens and after some processes closes several times on the start. After the application finally started I'd like to have 1 single connection. If I use sp_who2 stored procedure in MSSQL Enterprise Manager I see 2 open co

newbie selecting records from mssql db im trying to create a report in crystal, im trying to create a formula field... the db fields in question are 'balance' and 'clientID'... im trying to create a formula that sums the 'balance' field for a certain range of 'clientID'... the range of 'client

How to add 100 files to the setup package Hi, I'm using "Package and Deployment Wizard" to create the setup. It is possible to add one file at the time but I need about 100 files and that is extreme time consuming, especially to redo it for all releases. I found the Setup.lst and can open with te

Inputs to SystemTimeToTzSpecificLocalTime The function accepts "Time Zone" and "Universal Time". I can populate the "Time Zone" by the function which returns the local time zone, such as "AUS Eastern Standard Time". How can I populate the "Ti

WorkSheetFunction.Search -- Error Trapping Issue I am searching in a Loop through multiple lines of data and looking for conditions. There are at least 3 possible conditions for my fist pass through. 1. Search finds "defeated" 2. Search finds "you" 3. Search finds neither of the above I have the follow
Post new topic   Reply to topic    msvisual.com Forum Index -> VB General Discussions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group