Microsoft Knowledge Base Email Alertz

(326548) - 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...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 326548 - Last Review: September 16, 2003 - Revision: 3.1

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

This article was previously published under Q326548

On This Page

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.

Open Excel

The following code opens an Excel ISAM database:
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=c:\somepath\ExcelFile.xls;" & _
           "Extended Properties=""Excel 8.0;HDR=Yes;"";" 
				
NOTE: C is the drive, and somepath is the folder that contains the example Excel file (ExcelFile.xls). "HDR=Yes" 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  (http://kbalertz.com/Feedback.aspx?kbNumber=295646/EN-US/ ) HOWTO: Transfer Data from ADO Data Source to Excel with ADO

Open dBASE

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

Open Lotus 1-2-3

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


Open Paradox

The following code opens a Paradox ISAM database. If a Paradox 5.0 file (for example, PdxFile.db) is located at c:\somepath, where C is the drive, and where somepath is the folder that contains PdxFile.db, as follows:
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=c:\somepath;" & _
           "Extended Properties=Paradox 5.x;" 
				
specify the file name in the SQL statement as follows:
rst.Open "Select * From PdxFile", 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  (http://kbalertz.com/Feedback.aspx?kbNumber=230126/EN-US/ ) ACC2000: Using Paradox Data with Access 2000 and Jet

Open Text

If a text file (for example, TestFile.txt) is located at c:\somepath, where C is the drive, and where somepath is the folder that contains TestFile.txt, as follows:
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
       "Data Source=c:\somepath;" & _ 
       "Extended Properties=""text;HDR=Yes;FMT=Delimited;"";"
				
specify the file name in the SQL statement as follows:
rst.Open "Select * From TextFile.txt", 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 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcjetschema_ini_file.asp)

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
Keywords: 
kbhowtomaster KB326548
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate