
September 4th, 2012, 01:11 PM
|
|
Registered User
|
|
Join Date: Aug 2012
Posts: 5
Time spent in forums: 58 m 37 sec
Reputation Power: 0
|
|
Parsing Korean characters through ASP
Hello all,
I'm using ASP to grab data from an excel file stored on the server and display it on a page. The problem I'm having is that Korean characters are not showing up. Instead, I'm getting question marks.
Here's my code.
Code:
<html>
<head>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="949"%>
</head>
<body>
<%
Response.CodePage = 65001
Dim objConn, objRS, strSQL
Dim x
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DRIVER={Microsoft Excel Driver (*.xls)}; IMEX=0; HDR=NO; "&_
"Excel 8.0; DBQ=" & Server.MapPath("test-input.xls") & "; "
strSQL = "SELECT * FROM A1:Q10000"
Set objRS=objConn.Execute(strSQL)
Response.Write("<table border=""1"">")
Response.Write("<tr>")
For x=0 To objRS.Fields.Count-1
Response.Write("<th>" & objRS.Fields(x).Name & "</th>")
Next
Response.Write("</tr>")
Do Until objRS.EOF
Response.Write("<tr>")
For x=0 To objRS.Fields.Count-1
Response.Write("<td>" & objRS.Fields(x).Value & "</td>")
Next
Response.Write("</tr>")
objRS.MoveNext
Loop
objRS.Close
Response.Write("</table>")
objConn.Close
Set objRS=Nothing
Set objConn=Nothing
%>
</body>
</html>
The funny thing is...
Code:
Response.Write("<th>" & objRS.Fields(x).Name & "</th>")
displays the Korean characters just fine... but
Code:
Response.Write("<td>" & objRS.Fields(x).Value & "</td>")
gives me the ???'s.
Can anyone shed any light on this, and on what I should do to fix it?
Thanks,
Tam.
|