473,395 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Pasting Dissimilar Records into One Text File

I need to copy records from several different tables into one text file.
Although the tables have many common fields, they also contain several that
are different from table to table. I can copy and paste the dissimilar
records manually into the text file, so it would seem that should be
possible to do programatically.

I set up export specifications for each of the twelve tables and tried to
export each to the same text file. This resulted in the first tables records
being exported, but nothing at all happened with any table after that. Not
even an error message. (I switched the order of the exporting and each time
only the first table would export.) I next tried seperate export files for
each of the tables in the export specifications and that worked, but I had
twelve seperate text files. I also tried a TransferText on queries, but that
too resulted in only the first queries records being exported to the text
file and none after that.

So now I'm thinking the only way to do this is with some code and I haven't
a clue as to where to start. Can somebody give me a big shove in the right
direction, or does anybody know of a sample of something similar that I
could look at?

Thanks.
Mar 1 '07 #1
2 1797
Steve Cartnal wrote:
I need to copy records from several different tables into one text file.
Although the tables have many common fields, they also contain several that
are different from table to table. I can copy and paste the dissimilar
records manually into the text file, so it would seem that should be
possible to do programatically.

I set up export specifications for each of the twelve tables and tried to
export each to the same text file. This resulted in the first tables records
being exported, but nothing at all happened with any table after that. Not
even an error message. (I switched the order of the exporting and each time
only the first table would export.) I next tried seperate export files for
each of the tables in the export specifications and that worked, but I had
twelve seperate text files. I also tried a TransferText on queries, but that
too resulted in only the first queries records being exported to the text
file and none after that.

So now I'm thinking the only way to do this is with some code and I haven't
a clue as to where to start. Can somebody give me a big shove in the right
direction, or does anybody know of a sample of something similar that I
could look at?

Thanks.

Let's say T1 has fields F1, F2, F3
T2 has fields F1, F2, F3, F4

YOu could
Select F1, F2, F3, Null As F4 From T1
UNION ALL
Select F1, F2, F3, F4 From T1
to combine the two tables together.

Would this concept work?
Mar 1 '07 #2
Sounds like a good time for a loop.

Dim iFile as integer

iFile = FreeFile
Open sScrFile For Output As iFile

'Perform this loop for each table
for X = 1 to 12

...Open your table, write to an array or directly to the text file
i.e. Print #iFile, SomeFieldFromSomeTable

next X

Close #iFile
On Mar 1, 1:00 am, "Steve Cartnal" <scart...@alltel.netwrote:
I need to copy records from several different tables into one text file.
Although the tables have many common fields, they also contain several that
are different from table to table. I can copy and paste the dissimilar
records manually into the text file, so it would seem that should be
possible to do programatically.

I set up export specifications for each of the twelve tables and tried to
export each to the same text file. This resulted in the first tables records
being exported, but nothing at all happened with any table after that. Not
even an error message. (I switched the order of the exporting and each time
only the first table would export.) I next tried seperate export files for
each of the tables in the export specifications and that worked, but I had
twelve seperate text files. I also tried a TransferText on queries, but that
too resulted in only the first queries records being exported to the text
file and none after that.

So now I'm thinking the only way to do this is with some code and I haven't
a clue as to where to start. Can somebody give me a big shove in the right
direction, or does anybody know of a sample of something similar that I
could look at?

Thanks.

Mar 1 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeremy | last post by:
I have a pretty straightforward database that is designed to record free-form information about products (date, source and a memo field). This is searched and updated via a form. For new records,...
3
by: Mike | last post by:
Using MS Access XP standard install (no Jet or MDAC updates applied yet) as front end, MySQL 4.0 as backend and MySQL ODBC connector version 3.51. When pasting multiple records into the database...
3
by: TM | last post by:
Is there any way that I can take the records from a datagrid and paste them into an Excel sheet, then print preview or print the sheet ? Is there any way I can sort the sheet before I print it ?...
9
by: Regnab | last post by:
I've got a text box that I want users to paste a list of values into (from Excel for example). However, breaking this large string down into its component records is a little harder. I've used...
2
by: steph | last post by:
Hi all, I have an Access2002 form in in datasheet view. Column "CMP" is locked to user input, instead it is filled automatically by this function: === Private Sub Form_BeforeInsert(Cancel As...
13
by: Henry Townsend | last post by:
I hope this is on-topic in c.l.c - it's about the C preprocessor more than the language per se, more generally about the K&R behavior, and most specifically about the Sun cpp which is why I've...
1
by: alexsg | last post by:
A little while ago Ron P kindly responded to my inquiry on how to copy the first line of memo field into a text field, using a query: left(,instr(1,,vbCrLf)-1) This is great, but I would like...
1
by: Grant Smith | last post by:
I've got an application that I can copy some text out of the RichTextBox control. I would like to keep the formatting so I'm able to copy it to the Clipboard with RTF formatting. I have no...
5
by: exhuma.twn | last post by:
As many might know, windows allows to copy an image into the clipboard by pressing the "Print Screen" button on the keyboard. Is it possible to paste such an image from the clipboard into a "Text"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.