Excellent!! Thanks so much
FYI, I didn't do concat (and I don't employ it for printing on the screen), I used a loop.
I think I'm gonna reuse this admin page for every site I work on -- it's turning out to be darn useful
Follow-up question, though: On that dialog box, the default file type is *.htm,*.html. Is there any way I can make the default type *.*
Here's the code I use
If Request.Form("Save") <> "" Then ' The user wants to save the recordse
strExt = Request.Form("Save"
Select Case UCase(strExt
Case "TXT
strSep = vbTa
Case "CSV
strSep = ",
End Selec
strFile = "select." & strEx
Response.Clea
Response.AddHeader "Content-disposition","attachment;filename=" & strFil
For row = 0 To lngNumRow
For col = 0 To lngNumCol
thisfld = arrData(col,row
If IsNull(thisfld) The
thisfld = strNul
End I
Response.Write(thisfld
If col < lngNumCols The
Response.Write(strSep
End I
Nex
Response.Write(vbCrLf
Nex
' Manually close the connectio
objConn.Clos
Set objConn = Nothin
Response.En
End I
----- Patrice wrote: ----
Youn can "Response.Write" the file content to the browser (strin
concatenation is still not recommended
Using
Response.Clea
Response.AddHeade
"Content-disposition","attachment;filename=basenameAAMMJJ.t xt
Before sending the content will alow to raise the usual download dialog. Th
user will be able to save the file on his disk or to open the file (with th
program associated with the txt extension)
Patric
"MDW" <an*******@discussions.microsoft.com> a écrit dans le message d
news:84**********************************@microsof t.com..
Hey all I've got a web-based "database admin console" that uses ADOX, etc. t
query a database and return the tables, columns, etc to a form that I ca
then use to build SQL statements to run against that database. It's ver
"generic" - i.e., everything is dymanically created but pretty handy t
have If you send it a "SELECT" statement, it can print out a table on th
screen showing your recordset. No big deal. What I'd also like to include i
some way for users to get that output in a comma- or tab-delimited text fil
that they can use however they like. There are two ways I know of t
accomplish thi 1) Create a big string as I step through the recordset - (strOutput
strOutput & "'" & objRS(I) & "," .....) and then slap strOutput into
<textarea>. This is probably not desirable because the user would have t
copy all the content in that <textarea> and manually paste it into Notepa
or whatever 2) Use the FSO. However, my limited experience with the FSO leads me t
believe that I'd have to SAVE the resultant file before I can send it t
users. I don't want to do that Does anyone have any suggestions about how else I can accomplish this? Or
if FSO is the way to go (which I suspect it is), bear in mind that my onl
exposure to FSO is in the context of .vbs files....are there any specia
tricks you need to use for ASP TIA