Skip to main content

Notifications

Power Automate - Power Automate Desktop
Answered

Problem Execute SQL Statement

(0) ShareShare
ReportReport
Posted on by 290

Hello Community,

 

Please help me with the following,

I want to filter data from an Excel file through an SQL Connection, in order to filter some items, but I have problems with Execute SQL Statement. 

 

It throws me the following error: 

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Error en la instrucción SQL The Microsoft Access database engine could not find the object 'intercambio_proveedores_2022062'. Make sure the object exists and that you spell its name and the path name correctly. If 'intercambio_proveedores_2022062' is not a local object, check your network connection or contact the server administrator. ---> System.Data.OleDb.OleDbException: The Microsoft Access database engine could not find the object 'intercambio_proveedores_2022062'. Make sure the object exists and that you spell its name and the path name correctly. If 'intercambio_proveedores_2022062' is not a local object, check your network connection or contact the server administrator.
en System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr)
en System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
en System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
en System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
en System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
en System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
en System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
en System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
en Microsoft.Flow.RPA.Desktop.Modules.Database.Actions.DatabaseActions.ExecuteSQLStatement(Variant connectionString, Variant sqlConnectionVariable, Variant sqlCommand, Variant& result, Int32 timeout, Int32 getConnection)
--- Fin del seguimiento de la pila de la excepción interna ---
en Microsoft.Flow.RPA.Desktop.Modules.Database.Actions.ExecuteSqlStatement.Execute(ActionContext context)
en Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

fgonzalez515_0-1656381905179.png

 

fgonzalez515_1-1656381929689.png

 

fgonzalez515_2-1656381965455.png

 

Thanks

 

 

  • HazemSaleh Profile Picture
    HazemSaleh 29 on at
    Re: Problem Execute SQL Statement

    I know its solved but the best way to get dynamic sheet name 🙂

    HazemSaleh_0-1670494375636.png

    GL



  • fgonzalez515 Profile Picture
    fgonzalez515 290 on at
    Re: Problem Execute SQL Statement

    @VJR,

     

    Thanks

  • Verified answer
    VJR Profile Picture
    VJR 7,635 on at
    Re: Problem Execute SQL Statement

    Hey,

     

    in your case it should be [intercambio_proveedores_2022062$]

    instead of Sheet1$

  • fgonzalez515 Profile Picture
    fgonzalez515 290 on at
    Re: Problem Execute SQL Statement

    Hi @VJR,

     

    Keep throwing error,

     

    fgonzalez515_0-1656385282203.png

     

    fgonzalez515_1-1656385301198.png

     

     

  • VJR Profile Picture
    VJR 7,635 on at
    Re: Problem Execute SQL Statement

    Hi @fgonzalez515 

     

    The syntax to read an Excel sheet as a database is to suffix a $ sign to the sheet name as below.

     

    select * from [Sheet1$]

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard