Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 16th, 2003, 11:51 AM
Authorized User
 
Join Date: Jul 2003
Location: Urbana, IL, USA.
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default download db data to .xls with asp

I found a script to create a comma delimited spreadsheet. I have 2 problems with it. Help if you can.

1. It will save the object as a .asp file unless you rename it. How do I tell it the file is to have the extension .xls
2. It's a comma delimited file...we have comma's in our DB. I need to know how to change it to tab delimited or something like that.

the code:


<%
'
' prepare MS ACCESS connection
'
Dim connect, rs
Dim sSQL, Conn

Set connect = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateOBject("ADODB.Recordset")
connect.ConnectionString = _
  "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  "Data Source=" & sDataSource
connect.Open
%>

<%
    sSQL = "SELECT * " & _
           " FROM MasterTableCfoapal2"
    set rs = Connect.Execute(sSQL)




Dim F, Head
For Each F In rs.Fields
  Head = Head & ", " & F.Name
Next
Head = Mid(Head,3) & vbCrLf
Response.ContentType = "text/plain"
Response.Write Head
Response.Write rs.GetString(,,", ",vbCrLf,"")
%>


Reply With Quote
  #2 (permalink)  
Old October 16th, 2003, 06:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

check out http://www.greggriffiths.org/webdev/both/excel/ for some sample approaches to this issue.
Reply With Quote
  #3 (permalink)  
Old October 17th, 2003, 02:18 PM
Authorized User
 
Join Date: Jul 2003
Location: Urbana, IL, USA.
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks Greg

Reply With Quote
Reply


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 into the xls Sheet Directly without cl Kali Charan Tripathi Reporting Services 0 October 9th, 2008 06:40 AM
Unable to download sample codes Beginning ASP Data ckm2003 Wrox Book Feedback 1 November 2nd, 2007 07:56 AM
transfer data to xls with ADO not working nebbish Access 4 March 1st, 2006 08:55 PM
Secure MSAccess db ASP Data Page Integration Will Woodward Classic ASP Databases 1 October 26th, 2005 08:32 AM
Pulling data from an Access DB onto an ASP page Melissa Brown Classic ASP Databases 7 August 6th, 2004 09:16 PM



All times are GMT -4. The time now is 06:31 PM.


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