Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<%=RS("FirstName")%> to a Text File

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
Hello all, how's everyone doing today? good I hope. I have a question:

Q. How can I display data on a Text file from an Access database????

What I'm trying to do is that when a user searches for values the results be display on a Text file to make it better to print. Right now the results display on a HTML page and when 30 values are found it does not print properly on all pages cutting some records at the bottom of each sheet. Any help would be appreciated. QUOTE OF THE DAY
Everyone you meet knows something you don't know. Be willing to learn from them.

Jr_Clown :eek:)
 
Hey you clown! You could consider working with the FileSystemObject to write the recordset to a textfile. Check out some tutorials on how to write to textfiles, it shouldn't be more difficult than writing to HTML output.
To use the following code you should capture all of your recordset in a variable called "text":

<%
filename=server.mappath(&quot;/MyDir/MyTextFile.txt&quot;)
Set fs = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set writefile = fs.OpenTextFile(filename, 2, True)
writefile.writeline(Text)
writefile.Close
set writefile=nothing
set fs=nothing
%>

Set writefile = fs.OpenTextFile(filename, 2, True), in this line you specify that if MyTextFile.txt doesn't exist yet, a new textfile should be created. I hope this will help you get started. Good luck!




<webguru>iqof188</webguru>
 

Thanks for you input <webguru>iqof188</webguru> I will be picking up that task later today, I'll keep you posted. Thanks QUOTE OF THE DAY
Everyone you meet knows something you don't know. Be willing to learn from them.

Jr_Clown :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top