Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in input Chinese Character to SQL Server

Status
Not open for further replies.

lws

Programmer
May 6, 2001
14
HK
Hi,

I am using VB6 professional English Edition for developing Windows application. However I found that when I input Chinese Character to SQL Server. All the Chinese Character would become "???". I found I can read those Chinese Character, however I fail to input Chinese Character into SQL Server. Can anyone help to figure out what's wrong with this?

Thanks a lot
 

The standard varchar is non unicode as so is the char and text fields. You would need to change the field type to nvarchar, nchar, or ntext.

Good Luck

 
Hi Vb5programmer,

Thx for your reply, I found I still cannot insert Chinese Character into SQL Server although I changed the field into nvarhar nor ntext.

 

VB itself does not like unicode characters. First Q to ask you is can you insert/update with english ASCII characters to standard varchar field? If not it may be your syntax in code. Second thing you may need to look at is the StrConv function in vb or the cast operator in sql.

Good Luck

 
Another thing to consider is how your SQL Server collation settings have been configured. There you determine whether your SQL Server is accepting Unicode characters. I'm not sure what version you are using. This would have been configured during the installation, so check with the DBA.
 
Hi All,

Thx for your reply, I'm using SQL2000. I don't know whether this SQL server accept UNICODE or not. However I found I can input Chinese Character into SQL Server through its Console. But fail to do so by using VB program.

 
Hi All,

I found that if I input Chinese Character into SQL Database using SQL Query Analyzer, all the character would become "??". But its fine if I input Chinese Character by typing Chinese Character into table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top