By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,173 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Coding Problem

P: n/a
Dear all,

I am now creating a website which have 3 languages (English, Simplified
Chinese and Traditional Chinese). The server has installed English version
Window 2000 (Server Version, Default Codepage is Traditional Chinese) and
MSSQL 2000 (English). I have created a database which use the codepage
"chinese_PRC". However, when I created an testing asp pages ( 1 textbox and
it will insert the content into the table), it cannot store the chars in
correct coding. I would like to know whether asp or MSSQL has something
wrong in my setting? Thank you for all of your help.

Alex Yung
Jul 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You really need to give the error you are getting and maybe some sample data
you are trying to store.
If you are trying to store characters from another language that English,
does you db have the appropriate nchar
columns?

AJ
Jul 21 '05 #2

P: n/a
hi AJ,
here 's the 3 files , 1 form, 1 for inserting the records and 1 for
display in the screen

Form
----------------------------------------------------------------------------
--------------------
<%@ Language=VBScript CodePage=936 %>
<%
'mySmartUpload.form("c").values
'ENCTYPE="multipart/form-data"
%>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<form action="test3.asp" method="post" ENCTYPE="multipart/form-data">
<input type="text" name="c" value="" />
<input type="submit" name="submit" value="submit">
</form>
----------------------------------------------------------------------------
--------------------

Insert data
----------------------------------------------------------------------------
--------------------
<%@ Language=VBScript CodePage=936%>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<%
'Here I use aspSmartUpload to handle my data; however, it also doesn't work
when I use request object
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
mySmartUpload.Codepage = 936
mySmartUpload.Upload()
Set linkptr = CreateObject("ADODB.Connection")
linkptr.Open "Provider=sqloledb.1" & _
"Persist Security Info=True;" & _
"Data Source=127.0.0.1;" & _
"Initial Catalog=test;" & _
"User Id=abc;" & _
"Password=;"

sql = "insert into test (content) values ('" & mySmartUpload.form("c") &
"')"
linkptr.Execute sql
Response.Write sql
linkptr.Close
set linkptr = nothing

%>
----------------------------------------------------------------------------
--------------------
Display
----------------------------------------------------------------------------
--------------------
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<%
Set linkptr = CreateObject("ADODB.Connection")
' User ID: karin
' Pwd: irasia
linkptr.Open "Provider=sqloledb.1" & _
"Persist Security Info=True;" & _
"Data Source=127.0.0.1;" & _
"Initial Catalog=test;" & _
"User Id=abc;" & _
"Password=;"

sql = "select * from test"
Set rs = CreateObject("ADODB.RecordSet")
rs.CursorType = 3
rs.CursorLocation = 3
rs.LockType = 3
rs.open sql, linkptr

while not rs.eof
response.write rs.fields("content") & "<br>"
rs.movenext()
wend

rs.close
linkptr.Close
set rs = nothing
set linkptr = nothing
%>
----------------------------------------------------------------------------
--------------------
"Anthony Judd" <ad**********@optusnet.com.au> glsD
:u3**************@TK2MSFTNGP14.phx.gbl...
You really need to give the error you are getting and maybe some sample data you are trying to store.
If you are trying to store characters from another language that English,
does you db have the appropriate nchar
columns?

AJ

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.