Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old January 28th, 2005, 03:15 PM
Registered User
Join Date: Oct 2003
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to miaomiaoga Send a message via MSN to miaomiaoga
Default When I used "application/vnd.ms-excel" to export t


Export Method:

strFileNameExport = "Results"

Response.Buffer = True
Response.ContentType ="application/vnd.ms-excel" 'application/msword
Response.Addheader "Content-Disposition", "attachment;Filename=" &
strFileNameExport & ".xls"
Response.Charset = "GB2312"
Response.Codepage = "936"

tblHeader = "<html><body><table border=1>"
tblFooter = "</table></body></html>"

Response.Write tblHeader & strContent & tblFooter

I used this code to export the content of table to Excel File. But when i
opened the Excel file, sometime the words of the content would be showed as
"confused" words. But so strange the same table (same content), sometimes
would be "confused". And sometimes it would be showed normally. It's
randomly between "confused" words and normally words.

And I had tried to change all Charset and Codepage setting of all pages. But
same result.

Seems this problem not related with Charset and Codepage setting.

(All words showed "confused" is Chinese words. And english words all are
normally. Randomly showed this error sympton in Excel file.)

Environment: ASP,SQL2K,WIN2003.


Benny Ng

Reply With Quote
  #2 (permalink)  
Old October 20th, 2007, 04:00 AM
Registered User
Join Date: Oct 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts


Maybe, you should consider adding following

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

inside of <head> tags. Maybe you should try another codepage than utf-8. But this solved my problem.

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Export data to MS Excel in VB.NET DPARK0312 General .NET 1 December 9th, 2013 02:06 AM
"application/vnd.ms-excel" problem akeyworth Classic ASP Components 1 January 15th, 2008 12:09 PM
application/vnd.ms-excel Help! drumph Classic ASP Components 3 May 31st, 2007 06:02 AM
When I used "application/vnd.ms-excel" to export t miaomiaoga Classic ASP Databases 0 January 28th, 2005 03:12 PM
Using MS Excel in application justshahid VS.NET 2002/2003 2 January 13th, 2005 10:56 AM

All times are GMT -4. The time now is 09:00 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.