🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.databases.ms-access
2 messages
2 total messages Started by Advanced Development Group Tue, 05 Aug 1997 00:00
Saving individual fields to text files
#49
Author: Advanced Development Group
Date: Tue, 05 Aug 1997 00:00
7 lines
870 bytes
I have designed an Access v 2.0 database and want to save the
individual fields to text files.  For example, my database has 50
fields (Field1, Field2, Field3,... Field50) in it.  I want to run a
single command that will take these fields and save them to seperate
text files (thus Field1 will be saved as field1.txt, Field2 will be
saved as field2.txt etc.)
Re: Saving individual fields to text files
#50
Author: Larry Tubbs
Date: Tue, 05 Aug 1997 00:00
38 lines
2062 bytes
Hello,

Do you want each record in your database in a separate file as well?  If you
have 50 fields, and 50 records, are we talking about 2500 files???  Or, do
you want to have 50 files, file1 contains the contents of field1 for all 50
records, etc..

Either way, there is no built in Access function to do this type of export,
but you can write a little VBA routine that will do this.  Look in the
online help for the Open statement.  It will tell you how to create text
files.  Also look for the Print # and Write # statements that will allow you
to write data to a file once you open it.

After you know how to do that, it is a simple matter to create a recordset
object off of your table, loop through it, writing each file as you go.  The
entire thing could be kicked off and run from a single button, macro or
function call.

I hope this helps,


--

Larry Tubbs, MCPS, MCSD
Silverleaf Vacation Club
mailto:ltubbs@sprintmail.com
http://www.geocities.com/ResearchTriangle/5727/

Advanced Development Group wrote in article
<33e75cfe.8912449@news.mill.net>...

>I have designed an Access v 2.0 database and want to save the
>individual fields to text files.  For example, my database has 50
>fields (Field1, Field2, Field3,... Field50) in it.  I want to run a
>single command that will take these fields and save them to seperate
>text files (thus Field1 will be saved as field1.txt, Field2 will be
>saved as field2.txt etc.)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads