exporting to a text file...

Results 1 to 3 of 3

Thread: exporting to a text file...

  1. #1
    Join Date
    Dec 1969

    Default exporting to a text file...

    Anyone ever create an script that can call an Acess Database function that will export data from a table into a comma delimited file?<BR>Interested in pulling up a page on website and it automatically reads dbase and emails out a textfile. If possible and it has been done before, would that be the texstream object or is there a funtion that can already do that?

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default You will have to code it AFAIK

    use FSO<BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default You can get Access to do it...

    ...by "scripting" the Access.Application object. But it&#039;s a royal pain in the rear.<BR><BR>You can trivially create a .CSV file using ADODB.Recordset.GetString so long are there are no commas in any of the database fields.<BR><BR>Or you could wrap every field with "..." (to handle the embedded commas) so long as there are no quotes in the fields.<BR><BR>Or find some other delimiter that you *know* doesn&#039;t exist in the data.<BR><BR>Or or or...<BR><BR>But do look into GetString, in any case.<BR><BR>By default, it gives you a TAB delimited output, and since it&#039;s real unlikely you will have tabs in your db fields, that might be exactly what you want.<BR><BR>Just open the file, get the recordset, and then do<BR> outFile.Write RS.GetString( ) &#039; use all defaults!<BR>and you are done in one line!<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts