Question Exporting Query - Without Delimiters

DBFIN

Registered User.
Local time
Yesterday, 23:30
Joined
May 10, 2007
Messages
205
I'm creating a huge text file by exporting a query consisting of 25 fields. The text file must be formated so that each record consists of a single string including all 25 fields concatenated together. Each record must have a fixed length of 600. I've already converted the format of each field so they collectively add up to the required record length of 600, however each field is listed separately in the query.

When I export the query consisting of 25 separate fields, it includes delimiters such as commas between all fields. How can I export the data so each record is a single string including all field data without any delimiters ?
 
DBFIN,

This should at least work as a short-term work-around.

Code:
Dim rst As DAO.Recordset
Dim i As Integer

Open "C:\SomeFile.txt" For Output As #1

Set rst = CurrentDb.OpenRecordset("Select * From YourQuery")

While Not rst.EOF And Not rst.BOF
   For i = 0 To rst.Fields.Count - 1
       Print #1, rst.Fields(i);
       Next i
   Print #1, ""
   rst.MoveNext
   Wend

Close #1

Wayne
 
I need a solution that is not dependent on hard-coded language, such as using standard functions or expressions. I've tried using the advanced specifications, but have not found one that works.
 
What version of Access are you using and why can't you use code?
 
Have you tried using the Export wizard for Fixed Width fields?
 

Users who are viewing this thread

Back
Top Bottom