Microsoft KB Archive/326548

= HOW TO: Use Jet OLE DB Provider 4.0 to Connect to ISAM Databases =

Article ID: 326548

Article Last Modified on 9/16/2003

-

APPLIES TO


 * Microsoft OLE DB Provider for Jet 4.0
 * Microsoft ActiveX Data Objects 2.1
 * Microsoft ActiveX Data Objects 2.1 Service Pack 1
 * Microsoft ActiveX Data Objects 2.1 Service Pack 2
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.5 Service Pack 2
 * Microsoft ActiveX Data Objects 2.6
 * Microsoft ActiveX Data Objects 2.6 Service Pack 1
 * Microsoft ActiveX Data Objects 2.7

-



This article was previously published under Q326548



IN THIS TASK
SUMMARY
 * Open Excel
 * Open dBASE
 * Open Lotus 1-2-3
 * Open Paradox
 * Open Text



SUMMARY
This article describes how to use Jet OLE DB Provider 4.0 to connect to various external databases through installable ISAM drivers. Connection strings are provided for opening each ISAM database.

NOTE: The code in this article assumes that you have created an ADO Connection object: cnn, and an ADO RecordSet object: rst.

back to the top

Open Excel
The following code opens an Excel ISAM database: cnn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _ &quot;Data Source=c:\somepath\ExcelFile.xls;&quot; & _ &quot;Extended Properties=&quot;&quot;Excel 8.0;HDR=Yes;&quot;&quot;;&quot; NOTE:  is the drive, and   is the folder that contains the example Excel file (ExcelFile.xls). &quot;HDR=Yes&quot; indicates that the provider will not include the first row of the cell range (which may be a header row) in the RecordSet.

For additional information about connecting to a Microsoft Excel spreadsheet, click the article number below to view the article in the Microsoft Knowledge Base:

295646 HOWTO: Transfer Data from ADO Data Source to Excel with ADO

back to the top

Open dBASE
The following code opens a dBASE ISAM database. If a dBASE file (for example, dBaseFile.dbf) is located at, where   is the drive, and where   is the folder that contains dBaseFile.dbf, as follows: cnn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _ &quot;Data Source=c:\somepath;&quot; & _ &quot;Extended Properties=DBASE III;&quot; specify the file name in the SQL statement as follows: rst.Open &quot;Select * From dBaseFile&quot;, cnn,, ,adCmdText back to the top

Open Lotus 1-2-3
The following code opens a Lotus 1-2-3 ISAM database: cnn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _ &quot;Data Source=c:\somepath\Lotus123File.wk3;&quot; & _ &quot;Extended Properties=Lotus WK3;&quot; NOTE:  is the drive, and   is the folder that contains the example Lotus 1-2-3 file (Lotus123File.wk3).

back to the top

Open Paradox
The following code opens a Paradox ISAM database. If a Paradox 5.0 file (for example, PdxFile.db) is located at, where   is the drive, and where   is the folder that contains PdxFile.db, as follows: cnn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _ &quot;Data Source=c:\somepath;&quot; & _ &quot;Extended Properties=Paradox 5.x;&quot; specify the file name in the SQL statement as follows: rst.Open &quot;Select * From PdxFile&quot;, cnn,, ,adCmdText

NOTE: Not all versions of Paradox are supported by the Jet ISAM. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

230126 ACC2000: Using Paradox Data with Access 2000 and Jet

back to the top

Open Text
If a text file (for example, TestFile.txt) is located at, where   is the drive, and where   is the folder that contains TestFile.txt, as follows: cnn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;&quot; & _ &quot;Data Source=c:\somepath;&quot; & _ &quot;Extended Properties=&quot;&quot;text;HDR=Yes;FMT=Delimited;&quot;&quot;;&quot; specify the file name in the SQL statement as follows: rst.Open &quot;Select * From TextFile.txt&quot;, cnn,, , adCmdText

The Text ISAM permits you to handle multiple text file formats. You cannot define all characteristics of a text file through the connection string. For example, if you want to open a fixed-width file, or you want to use a delimiter other than the comma, you must specify all these settings in a Schema.INI file. For more information about about Schema.INI files, visit the Microsoft Developer Network (MSDN) Library at the following Web site:

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

back to the top

Keywords: kbhowtomaster KB326548

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.