navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Download DRW Results

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Download DRW Results
Page: [1]
 
phfdfp

 

Posts: 15
Joined: 4/4/2007
Status: offline

 
Download DRW Results - 6/30/2008 22:27:51   
I would like to give users the option of downloading filtered DRW results into a CSV file...... thoughts on how to do this...

All comments appreciated....

Jim
DesiMcK

 

Posts: 445
Joined: 4/26/2004
From: Essex, UK
Status: offline

 
RE: Download DRW Results - 7/1/2008 17:12:14   
I use this:

<%
Dim DSN, RS, SQL, Conn


DSN="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("../targets.mdb")

SQL = "ENTER SQL HERE"


set Conn=server.createobject("adodb.connection")
Conn.open DSN
Set RS = Conn.Execute (SQL)

Dim F, Head
For Each F In RS.Fields
Head = Head & ", " & F.Name
Next
Head = Mid(Head,3) & vbCrLf
Response.Addheader "Content-Disposition", "inline; filename=myExportName.csv"
Response.ContentType = "application/download"
Response.Write Head
Response.Write RS.GetString(,,", ",vbCrLf,"")
Set RS = nothing
Conn.close
%>

Desi

(in reply to phfdfp)
phfdfp

 

Posts: 15
Joined: 4/4/2007
Status: offline

 
RE: Download DRW Results - 7/3/2008 0:28:30   
outstanding!!! it works thanks.... but wait theres more...

i need to have it filtered like the form it comes from and i would like to DL only certain fields from the DB....

when i leave the selct from results where ........ it does not work... If i remove where..... it works but i get the whole file

Any more magic??

Thanks

(in reply to DesiMcK)
DesiMcK

 

Posts: 445
Joined: 4/26/2004
From: Essex, UK
Status: offline

 
RE: Download DRW Results - 7/3/2008 12:22:00   
Can you post the SQL from your DRW please.

(in reply to phfdfp)
phfdfp

 

Posts: 15
Joined: 4/4/2007
Status: offline

 
RE: Download DRW Results - 7/3/2008 17:58:55   
sure thanks

from the labels page

fp_sQry="SELECT * FROM Results WHERE (services_provided LIKE '%::services_provided::%')"
fp_sDefault="services_provided="
fp_sNoRecords="No records returned."
fp_sDataConn="associate_members"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&Key=3&Company_Name=202&Address=202&Choice=2&contact_name_last=202&contact_name_first=202&city=202&state=202&zip=202&level=202&phone=202&fax=202&contact_email=202&services_provided=202&other_remarks=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&web_site=202&other_remarks1=203&greatest_benefit=203&add_fasd=203&more_education=202&sponsor_ed=202&provide_spealers=202&"
fp_iDisplayCols=7
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>



from the dl page

<%
Dim DSN, RS, SQL, Conn


DSN="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("../fpdb/associate_members.mdb")

SQL = "SELECT * FROM Results "

set Conn=server.createobject("adodb.connection")
Conn.open DSN
Set RS = Conn.Execute (SQL)

Dim F, Head
For Each F In RS.Fields
Head = Head & ", " & F.Name
Next
Head = Mid(Head,3) & vbCrLf
Response.Addheader "Content-Disposition", "inline; filename=myExportName.csv"
Response.ContentType = "application/download"
Response.Write Head
Response.Write RS.GetString(,,", ",vbCrLf,"")
Set RS = nothing
Conn.close
%>


(in reply to DesiMcK)
phfdfp

 

Posts: 15
Joined: 4/4/2007
Status: offline

 
RE: Download DRW Results - 7/3/2008 17:59:24   
THANKS for looking!!!

(in reply to DesiMcK)
DesiMcK

 

Posts: 445
Joined: 4/26/2004
From: Essex, UK
Status: offline

 
RE: Download DRW Results - 7/3/2008 18:08:22   
Try this - I am assuming that the user clicks on a link to export to csv.

On the first page put a link in:-

<a href="downloadCSV.asp?Services=<%=Request("services_provided")%>Click to download CSV</a>

on csv code page use this SQL:

SQL = "SELECT * FROM Results WHERE (services_provided LIKE '%" & Request("Services") & "')"

(in reply to phfdfp)
phfdfp

 

Posts: 15
Joined: 4/4/2007
Status: offline

 
RE: Download DRW Results - 7/7/2008 22:51:59   
i am using a button with the properties post and submit.

I put in the suggested code and changed the sql on the download page..

it works but still downloads all records????

Any other ideas????

Thanks

(in reply to phfdfp)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Download DRW Results
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts