web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Running MS Access save...
Power Automate
Answered

Running MS Access saved Insert and Update queries

(0) ShareShare
ReportReport
Posted on by 51

Hi Everyone,

 

I have an MS Access database that I am working with and there are a number of stored parametised queries for inserting and updating records. Is there a way to 'call' these stored queries to add and update records, or am I going to have to grab the SQL from each one and re-create it in PAD? I am not the maintainer of this database so I would very much like to be able to use the saved queries if possible.

Thanks for taking a look at this for me. Any help greatly appreciated.

@MisterH

  • kinuasa Profile Picture
    801 Most Valuable Professional on at

    Hi,
    I suggest that to run a script like the following using the "Run VBScript" action.

     

    Regards,
    kinuasa

     

    Dim con 'ADODB.Connection
    Dim cmd 'ADODB.Command
    Const DBFilePath = "C:\Test\Sample.accdb"
    Const QueryName = "TargetQuery"
    
    Set con = CreateObject("ADODB.Connection")
    con.Open "Provider=Microsoft.ACE.OLEDB.16.0;Data Source=" & DBFilePath & ";Persist Security Info=False;"
    With CreateObject("ADOX.Catalog")
     Set .ActiveConnection = con
     Set cmd = .Procedures(QueryName).Command
     cmd.Execute
    End With
    con.Close
  • Verified answer
    MisterH Profile Picture
    51 on at

    Hi Kinuasa,

    Thanks for having a crack at this. What you are suggesting is to step outside the flow altogether which defeats the purpose of having the control of the flow.

    I have discovered the answer though:

    eg/        EXECUTE [yourQueryNameHere] "Some Text Value"

     

    The values that you place after the [yourQueryNameHere] need to be in the order they are specified in the query (the one you are calling in MS Access). The data types should also match.

     

    eg/         EXECUTE [yourQueryNameHere] "Some Text Value", 123.45, "Another Text Value"

     

    I hope this helps anyone else looking to execute queries, particularly parametised ones inside of MS Access.

     

    Cheers

     

    MisterH

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 213 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 151

Last 30 days Overall leaderboard