PRB: Error in Data View Showing Text Based Data Source

ID: Q180797

The information in this article applies to:

SYMPTOMS

When you use a Data View in Microsoft Visual Interdev you may receive this error:

   ODBC Error: S1000: [Microsoft] [ODBC Text Driver] The Microsoft jet
   database engine does not recognize 'TEXT.TXT.*' as a valid field name or
   expression.

CAUSE

The Microsoft ODBC text driver examines a designated folder for text files with extensions that were specified when the data source name (DSN) was created. Each text file, such as Text.txt is seen as a table. When Visual Interdev attempts to build a SQL query, it uses the filename as a table name and the period in the filename is an invalid character for a SQL table name.

RESOLUTION

Here are the steps to resolve the error:

1. When you create the DSN, add the *.* extension to the list of extensions

   and save the text data source without an extension. Make sure that you
   do NOT select the 'Default(*.*)' check box because it will not show all
   files.

2. In Visual Interdev, when you receive the error message, click OK. If the
   Query toolbar is not displayed right-click the toolbar client area and
   choose Query. Select the Show SQL Pane toolbar button and modify the SQL
   to a valid SQL statement.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

1. Create a tab delimited text file with the name Text.txt.

2. In the ODBC Data Source Administator dialog box, select the System DSN

   tab and click ADD.

3. Double-click the Microsoft Text Driver.

4. Enter a name and description for the data source.

5. Clear the Use Current Directory check box and click the Select Directory

   command button to locate the folder with the text data source.

6. Click the Options command button. In the Extension text field, enter *.*
   and click ADD.

   NOTE: Do not select the 'Default (*.*)' check box.  A bug in this driver
   causes it not to display any files.

7. Click Define Format and select the text data source from the Tables list
   box. Select Tab Delimited in the Format combo box.

8. The Columns frame contains options to define the field names in the text
   data source.

Use this DSN in Microsoft Visual Interdev to view the data in 'Data View'.

Keywords          : oledbErrMsg 
Version           : WINDOWS:1.0,1.5
Platform          : WINDOWS
Issue type        : kbprb

Last Reviewed: May 19, 1998