473,767 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1820
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, SomeFieldFromSo meTable

next X

Close #iFile
On Mar 1, 1:00 am, "Steve Cartnal" <scart...@allte l.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
4721
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, the memo field is usually filled by cutting and pasting from e-mails, web content and spreadsheets. The only problem is that some of the memos can be just a few words, and some can be tens or hundreds of lines, and I've realised that zooming...
3
2305
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 either in a form or directly in the table, all records / fields display #deleted in each column. This only happens when pasting multiple records, if a single record is pasted, the #deleted comment does not appear. When I refreash the view, the...
3
1225
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 ? Thanks all -- Tony
9
7705
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 left(), mid() etc but they depend on a set number of characters for each line. I'm wondering if there is an operator which detects the new line and so would allow me to icut each line and put it into an array. Also wonding if there is a setting in...
2
1713
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 Integer) On Error GoTo Form_BeforeInsert_Err Dim db As Database Dim rst As Recordset
13
2939
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 cross posted there. The test case below is taken from an Imake setup (yes, old, I know). There's a Concat() macro which uses old-style /**/ for token pasting (we are not allowed to assume ANSI so ## isn't allowed). I'm trying to paste AND expand...
1
3055
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 to do this on a form, so that the person entering the memo can use a button to paste the 1st line to a title (text) field. I'm having trouble setting up the code to do this. I'd also appreciate some ideas on how to get the 2nd and 3rd lines...
1
3795
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 trouble pasting the formatted text into wordpad (which supports RTF formatting) but it won't paste into notepad (no RTF support). I know that if I copy something in wordpad with RTF formatting and then paste it into notepad the text will paste. What...
5
6882
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" widget in Tkinter? Here is my first attempt with just trying to print out the image data: ----------------- def pasteImg(tgt): global clipboardEnabled if not clipboardEnabled: return
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9960
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7383
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.