473,320 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Coding Problem

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
2 1805
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
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> ¼¶¼g©ó¶l¥ó·s»D
: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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Berthold Höllmann | last post by:
I have a default coding header # -*- coding: iso-8859-15 -*- in my python files. I now have Problems with this settings. I swithched to Python 2.4.1 under Windows. When I import files with the...
2
by: manning_news | last post by:
Has anyone had a problem with Access 2003 not saving their coding? I've been using 2003 for a couple of months now and just this week noticed that some coding I'd done for a database was not there...
144
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this...
1
by: R Reyes | last post by:
Hello All, I'm always looking for ways to improve my code. Most of the time (whenever I'm working on a project) I write a bunch of functions. Then after the project is finished, I put all the...
20
by: TJ Doherty | last post by:
Need help understanding the following please: When I am creating a project and code my connection using Dim connectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data...
4
by: Josh Golden | last post by:
i lead a small development team (based on some of my posts that might cause some people to choke themselves, but have no fear, i am NOT the lead developer, the people on my team are great - i'm...
8
by: Ilias Lazaridis | last post by:
Where can I find practical coding examples for real life coding problems? Something like a categorized solution guide? - My current problem: * create a folder * seems to be:...
7
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
0
by: pat | last post by:
CodeCheck Coding Standard's Support As a free service to our customers we offer support in developing "rule-files" for automating corporate coding standards. If you have a coding standard that...
8
by: =?ISO-8859-1?Q?Arnaud_Carr=E9?= | last post by:
Hi all, I guess you all know how difficult it is to choose a conding standard. And even more difficult it is to explain the choice to your dev team :-) I'm looking for an "official" c++ coding...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.