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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read from Access queries and write to text file

Status
Not open for further replies.

esteiner

Programmer
Oct 31, 2003
24
0
0
Hello,

I have data in an Access table that I would like to export to multiple HTML tables. I would like to split the data in the Access table (about 92,000 records) into multiple HTML tables/files to reduce download time and bandwidth usage on my web server. That way, the user can select a particular page to download instead of downloading a page with all of the records.

I would like to set a limit of only 500 records per file.

For example, I would like to be able to read from an Access Query, 'qryA'. This query selects all records whose part number starts with "A".

The pseudo-code for the routine that I would like to run is as follows:

// Variables
RecordCount = 1
PageCount = 1
Buffer = some kind of temp space
Outfile = qryA-(PageCount).shtml
// (The filename for the first pass would be qryA-1.shtml)

Read all records from qryA into Buffer
while not EOF (Buffer)
{
----->write to Outfile &quot;<table>&quot;
-----> while RecordCount <= 500 {
-------->read next line from 'Buffer'
-------->write to Outfile &quot;<tr><td>Buffer.fieldA</td></tr>&quot;
-------->write to Outfile &quot;<br>&quot;
-------->RecordCount = RecordCount + 1
--------> }
------> write to Outfile &quot;</table>&quot;
------> Close Outfile
------> RecordCount = 1
------> PageCount = PageCount + 1
}

This seems to be a fairly simple alorithm, but I have not coded in quite some time. Can anyone suggest a language that would be best (and fairly simple) to implement this idea? I am running Windows 98 if that is important.

Thank you very much in advance.
 
Access VBA should work just fine, esteiner. It's closest to the data and you can probably set up a scheduled task to output the pages on a regular basis.

Good luck,

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top