[AccessD] 2 qstions: Create table using UNION; Export to flatfile

Gustav Brock gustav at cactus.dk
Tue Oct 26 04:40:56 CDT 2004


Hi S

> First question:
> I need to create a table using a UNION query. How can I do this?

Create a union query, then use that as source for the append/create
query.
 
> Second question:
> I need to create a TAB-delimited flatfile using the table created above. How do I do that?
 
Create a query something like this:

  SELECT
    Field1,
    Field2
  INTO
    [Text;Database=C:\Windows\Temp].[YourFile.txt]
  FROM
    YourTable;

Before running this, create (or modify) the file schema.ini in the
destination folder:

[YourFile.txt]
ColNameHeader=False
CharacterSet=ANSI
Format=TabDelimited
Col1=Field1 Char Width 50
Col2=Field2 Char Width 50

The output file (YourFile.txt) must not exist before you run the
query.
As you can see, you may not need the temp table at all; use the union
query as source when creating the text file.

For more into on schema.ini file syntax, look here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcjetschema_ini_file.asp

/gustav




More information about the AccessD mailing list