Specification of extended properties in the OleDb? Connection string?

I'm currently looking for properties for a connection string that can be used to connect to an Excel file in readonly mode. A Google search gives me many examples of connection strings, but I cannot find a specification of all the features in the "Advanced Properties" section of the OleDb connection string.

At the moment I have this:

Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\Data\Customers.xls; Extended Properties = 'Excel 8.0; Mode=Read; ReadOnly=true; HDR=Yes'; 

However ... I made this up with examples. So the questions are: 1. What is a decent source for OleDb Connection String documentation / link? 2. Is the connection string above really a connection to an Excel file in readonly mode?

Thanks!

+4
source share
1 answer

I use the UDL file for this.

Do the following:

  • create an empty test.udl file
  • open it
  • The Data Link Properties dialog box appears.
  • On the first tab, change the provider to Microsoft.Jet.OLEDB.4.0;
  • The second tab allows you to select an Excel file
  • Resolution of the third tab, for example Read
  • On the last tab, Extended Properties = 'Excel 8.0; HDR = Yes

How to save and open the file in a text editor, and you will see a connection string

Also you can check the article msdn properties and parameters ADO provider

+2
source

Source: https://habr.com/ru/post/1308328/


All Articles