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

Export a database table using ASP

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Hi,

I want to be able to use ASP to export an MS Access table to a fixed width text file for later upload to a production database system. As I see it there are two possible ways but I don't know if either can be done or how to do them:

1. Write a macro in Access to export the tables and call this macro from an ASP program.
2. Read the data from the table into a recordset in ASP and ouput the data in the correct fixed width format to a text file.

Any help would be appreciated. Mise Le Meas,

Mighty :)
 
Since ADO 2.1 you can persist a recordset into an XML text file, and since 2.5 you can persist the data in either a file or any object that supports the IStream interface. To answer you question, I would select all the contents from a table, use the Recordset.Save method and write the text file. The XML is saved in a proprietary format, but it also is "loadable" when needed by ADO. You can indicate that file as a source and ADO will reconstruct the recordset.

gettin' jiggy wid' it --
smbure
 
smbure,

I don't think that this is going to solve my problem. I tried what you suggested and read in all the fields from the table and then used recordset.save. While it did store the recordset in the output file - it is not in a format that I require.

I need to be able to upload the output file to our Btrieve production system. Btrieve requires that the file be a fixed-width flat text file. I am trying to export the contents of an Access table to this format. I know that I can generate a Macro to do this. The problem is that I will be calling an ASP program to populate empty fields in the table and I would like this ASP program to be able to handle the export also.

Can it be done any other way that what you suggested? Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top