Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 COLLATE Chinese_Taiwan_Stroke_CI in ASP

Author  Topic 

micnie_2020
Posting Yak Master

232 Posts

Posted - 2010-06-23 : 06:03:14
Dear Everyone,

My databse create table using COLLATE Chinese_Taiwan_Stroke_CI.

But when i try to called using asp script. I getting result ????

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>test</title>
<meta http-equiv="Content-Language" content="zh-tw">
</head>
<body>
<%
Session("strDSN")="Provider=SQLOLEDB.1;Persist Security Info=True; Initial Catalog=taiwan;Data Source=ga;user id=Gio;pwd=Gad877;"

set conn = Server.CreateObject("ADODB.Connection")
conn.connectiontimeout = session("ODBC_TOUT")
conn.ConnectionString=session("strDSN")
conn.open
csql="select * from news"
set rs=conn.execute(csql)
if not rs.eof then
do while not rs.eof
response.write rs("title")&"<br>"
rs.movenext
loop
rs.close
end if


conn.close
set conn=nothing
%>
</body>
</html>


Please advise.

Thank you.

Regards,
Micheale

Sachin.Nand

2937 Posts

Posted - 2010-06-23 : 06:32:14
Try putting session.codepage=65001 at the start of page to so that ASP can send data to browser in UTF-8 format.



Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

micnie_2020
Posting Yak Master

232 Posts

Posted - 2010-06-23 : 09:03:22
Dear Idera,

Still unable to get the correct character. It's still display ???? instead chinese character.

Please Advise.

Thank you.

Regards,
Micheale
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-06-23 : 09:36:22
How have you set the code page?
Is it <% @ codepage=65001 %> ?


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

micnie_2020
Posting Yak Master

232 Posts

Posted - 2010-06-23 : 09:46:02
Dear Idera,

Yes. But not function. Still show ???.

CREATE TABLE [dbo].[NEWS2](
[title] [varchar](254) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL)

insert into [NEWS2]
(title)
values
('?????')






'ASP Source code
<% @ codepage=65001 %>
<%
response.expires = 0
response.expiresabsolute = Now() - 1
response.addHeader "pragma","no-cache"
response.addHeader "cache-control","private"
response.addHeader "P3P","CP='CAO PSA OUR'"
response.CacheControl = "no-cache"


'session.codepage=950

Session("strDSN")="Provider=SQLOLEDB.1;Persist Security Info=True; Initial Catalog=taiwan;Data Source=ga;user id=GO;pwd=GT;"

set conn = Server.CreateObject("ADODB.Connection")
conn.connectiontimeout = session("ODBC_TOUT")
conn.ConnectionString=session("strDSN")
conn.open
csql="SELECT * FROM NEWS2"
set rs=conn.execute(csql)
if not rs.eof then
do while not rs.eof
response.write rs("TITLE")&"<br>"
rs.movenext
loop
rs.close
end if


conn.close
set conn=nothing
%>
</body>
</html>



You may try it.

Thank you very much for your valuable times.

Regards,
Micheale
Go to Top of Page
   

- Advertisement -