Coding Problem

A

Alex

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
 
A

Anthony Judd

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
 
A

Alex

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
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top