Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Using SQL to Export to Unicode by Means of the Jet Provider and Text ISAM


View products that this article applies to.

Summary

You can use Structured Query Language (SQL) to export a table to a Unicode text file by means of the Microsoft Jet Provider and Text ISAM.

↑ Back to the top


More information

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

The first two examples show you how to use queries to import and export text to and from the sample database Northwind.mdb. To set up an example, create a new query (do not add any tables), click the SQL button, and type the corresponding SQL statement. Then, to import or export, just run the query. The third example shows you how to export a table in Unicode format.

Example 1

The following SQL code shows you how to export a table to a text file:
SELECT * INTO
[Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;].[OutCustomers#txt]
FROM Customers;
				

Example 2

The following SQL code shows you how to import a table from a text file (this is the one created in the first example):
SELECT * INTO ImpCustomers
FROM [Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;].[OutCustomers#txt];
				

Example 3

To modify the SQL statement so that it exports the data in Unicode text format, add the following option to the connection argument:
CharacterSet=Unicode
				
For example, you can modify the statement in Example 1 to the following:
SELECT * INTO
[Text;FMT=Delimited;HDR=Yes;DATABASE=C:\TEMP;CharacterSet=Unicode].[OutCustomersUNI#txt]
FROM Customers;
				

↑ Back to the top


Article Info
Article ID : 234201
Revision : 3
Created on : 1/1/0001
Published on : 1/1/0001
Exists online : False
Views : 315