Exporting Access data

J

Joann Figueras

I developed a front-end for a purchased database that was originally
three ASCII sequential flat files that I reformatted to create my
database. This year the purchased database is a .mdb file. How can I
extract the data from the .mdb to create the flat files that I
currently use?
Thanks (I hope!) John
 
K

Ken Sheridan

John:

If the data from each original file is now represented by a number of
related tables in the .mdb file you would first need to join the tables in a
query and export that query as a fixed width text file.

As an example the following query using the Suppliers, Products and
Categories tables from the sample Northwind database which comes with Access
would return all suppliers and their products ordered by country and then
supplier name:

SELECT Suppliers.SupplierID, CompanyName,
Address, City, Region, PostalCode, Country, Phone, Fax,
Products.ProductID, ProductName, QuantityPerUnit, UnitPrice,
Categories.CategoryID, CategoryName, Description
FROM Categories INNER JOIN (Suppliers INNER JOIN Products
ON Suppliers.SupplierID = Products.SupplierID)
ON Categories.CategoryID = Products.CategoryID
ORDER BY Country, CompanyName;

You can of course create the query visually in query design view rather than
entering the SQL directly.

Having created and saved the query select it in the database window, then
select Export from the File menu on the main database menu bar. In the
common dialogue select text file as the file type, browse to the folder where
you want to create the file , give it a suitable name and exit the dialogue.
Then simply follow the steps in the export wizard to create a fixed width
text file.

Ken Sheridan
Stafford, England
 
Top