473,385 Members | 2,004 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,385 software developers and data experts.

Display Korean characters from an excel spreadsheet via an ADO Recordset

Hello,

I'm pulling the contents of an Excel spreadsheet into an ADO recordset and then displaying them on a web page. The problem I'm having is that Korean characters are not displaying.

I have set the codepage in the <@ %> at the top the page to '65001', I've set the charset to "utf-8", the spreadsheet is saved as utf-8 and so is my asp page.

I know it's not a problem with the server not having the Korean language pack installed, because Response.Write(objRS.Fields(x).Name) displays the Korean characters in the 1st row of my spreadsheet.

It's only Response.Write(objRS.Fields(x).Value) that displays '???' instead of the characters and I cannot, for my very life, figure out why.

Here's my code:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  4. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  5. </head>
  6. <body>
  7.  
  8. <%
  9.  
  10. Response.CodePage = 65001
  11. Response.CharSet = "utf-8"
  12.  
  13. Dim objConn, objRS, strSQL
  14. Dim x
  15.  
  16. Set objConn = Server.CreateObject("ADODB.Connection")
  17. objConn.Open "DRIVER={Microsoft Excel Driver (*.xls)}; IMEX=1; HDR=YES; "&_
  18.     "Excel 8.0; DBQ=" & Server.MapPath("import-test.xls") & "; "
  19.  
  20. strSQL = "SELECT * FROM A1:E1000"
  21. Set objRS=objConn.Execute(strSQL)
  22. Response.Write("<table border=""1"">")
  23. Response.Write("<tr>")
  24. For x=0 To objRS.Fields.Count-1
  25.           Response.Write("<th>" & objRS.Fields(x).Name & "</th>")
  26. Next
  27. Response.Write("</tr>")
  28. Do Until objRS.EOF
  29.     Response.Write("<tr>")
  30.     For x=0 To objRS.Fields.Count-1
  31.             Response.Write("<td>" & objRS.Fields(x).Value & "</td>")
  32.     Next
  33.     Response.Write("</tr>")
  34.     objRS.MoveNext
  35. Loop
  36. objRS.Close
  37. Response.Write("</table>")
  38. objConn.Close
  39. Set objRS=Nothing
  40. Set objConn=Nothing
  41. %>
  42. </body>
  43. </html>
If anyone could please, please tell me how to solve this weird problem, I would be forever grateful, I'm tearing my hair out here!
Sep 7 '12 #1
1 2699
zmbd
5,501 Expert Mod 4TB
Poke in the dark...
Sorry, not much direct help for you here as this is a tad out of my depth. What I can offer is some critical thinking skills for troubleshooting....

Hopefully, nothing too silly - I'm not really sure where your problem is so, just a few questions:

You can see the Korean charactors in the workbooks?

When you open the ADO database directly, can you see them in the tables?

And my sillest question of the day: Have you tried to open the test page on a computer that you know for sure is able to display the Korean charactor set?

-z
Are you sure the cat didn't un-plug the tele?
I understand, but you know how cats like to play... just a quick peak and poke if you would........
Oh, That's OK, Glad it was an easy fix.
Sep 10 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jim, N2VX | last post by:
I'd like to create/display an Excel spreadsheet from javascript. We have an HTML page with results of a search and it can be reasonably large. The first attempt was to format the data into an...
2
by: Colleyville Alan | last post by:
I have been working on an application that queries data from Access, loads it into an array, and then writes it to an Excel spreadsheet. I use the array approach to have fine control over spacing,...
9
by: (Pete Cresswell) | last post by:
I see this coming on a develpment effort that may materialize shortly. These guys don't want to mess around with automated imports from text feeds BC in the past they've had too many problems...
5
by: Tim Marsden | last post by:
Hi I am a complete ASP novice. Is it possible to display an Excel spreadsheet in a web page? Can any input to the sheet be captured and sent back to the server? Regards Tim
4
by: washoetech | last post by:
Hello, I am working on a project where I need to be able to grab the data from an Excel spreadsheet and create a new table in my database based on the columns in the spreadsheet. After the...
0
by: lolera | last post by:
I am looking to create an xml file in a c# component (ran on a scheduled basis) and then display that xml data in an excel spreadsheet in the IE browser. So I have and xml file and then create an...
5
by: barbara_dave | last post by:
Hi All, I need to read data from a Excel spreadsheet, but I got the problem when I tried the code below: StringBuilder sbConn = new StringBuilder();...
3
by: D.Stone | last post by:
I'm trying to import an Excel spreadsheet into an existing Access table using Office 2003. Ultimately, the plan is to do it programmatically using TransferSpreadsheet, but to check that the file...
1
by: Sport Girl | last post by:
Hi everybody , i have the task of developing in Perl a script that retrieves data from 3 tables ( bugs, profiles, products) from a MySQL database called bugs and display them in an excel sheet...
1
by: ahron90 | last post by:
Hi, I'm working on a project which requires me to plot a graph using Visual Studio ASP.Net from a data I've collected either in .txt or .xml format. The data consist of, eg. 15 records, but I'm...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.