Share via

what is the connection string for excel file - xlsx file to open the file to run DML opertions

balasubramanian krishnamurthy 20 Reputation points
2026-03-06T13:44:37.7666667+00:00

please let me know the connection string to exceol file xlsx file to do the open,red wrie operations

how to install latest driver for excel in windows 11

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

Answer accepted by question author
  1. Q&A Assist
    2026-03-06T13:44:49.59+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To run SQL-like (DML) operations against an .xlsx Excel file on Windows, use an OLE DB connection string with the ACE provider and then execute SQL statements over that connection.

    Example connection string for .xlsx (read/write DML):

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Path\To\YourFile.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES";
    

    Explanation of key parts:

    • Provider=Microsoft.ACE.OLEDB.12.0; – Uses the ACE OLE DB provider for Excel.
    • Data Source=... – Full path to the .xlsx file.
    • Extended Properties="Excel 12.0 Xml;HDR=YES";
      • Excel 12.0 Xml – Indicates an .xlsx-format workbook.
      • HDR=YES – First row contains column names (use HDR=NO if the first row is data).

    Once the connection is open, SQL statements can be executed such as:

    SELECT * FROM [Sheet1$]
    INSERT INTO [Sheet1$] ([Column1], [Column2]) VALUES ('Value1', 123)
    UPDATE [Sheet1$] SET [Column2] = 456 WHERE [Column1] = 'Value1'
    DELETE FROM [Sheet1$] WHERE [Column1] = 'Value1'
    

    If the Excel column has mixed data types and values are being dropped or converted to NULL, add IMEX=1 to the extended properties to treat all data as text:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Path\To\YourFile.xlsx;Extended Properties="Excel 12.0 Xml;HDR=YES;IMEX=1";
    

    How to install the Excel OLE DB driver (ACE) on Windows 11

    To use the above connection string, the Microsoft Access Database Engine (ACE OLE DB provider) must be installed.

    1. Download and install Microsoft Access Database Engine 2010 Redistributable or a newer ACE redistributable (for example, 2016) appropriate for the system.
    2. Choose the correct bitness (32-bit or 64-bit) to match the application that will open the connection.
    3. After installation, the Microsoft.ACE.OLEDB.12.0 provider becomes available for use in connection strings like the ones above.

    In Power Automate for desktop, the same provider is used with a variable for the file path, for example:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=%Excel_File_Path%;Extended Properties="Excel 12.0 Xml;HDR=YES";
    

    This pattern applies equally when using other tools or custom code on Windows 11, as long as the ACE provider is installed.


    References:

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.