locked
Possible to create stored procedures in Access by code? RRS feed

  • Question

  • User1449393024 posted

    Hi there.

    I know in Access 2010 we can have named macros.

    I want to know if it's possoble to create them with a code like this:

    CREATE PROC Test

    @ID int

    AS

    ...

    Sunday, September 22, 2013 10:39 AM

Answers

  • User-821857111 posted

    Yes, you can use DDL to create saved queries (which is what stored procedures are called in Access). You can pass this DDL to the CommandText property of an OleDbCommand and execute it against the database.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 22, 2013 4:56 PM

All replies

  • User2019981500 posted

    Hi

    Access 2010 has both stored procedures, and also has table triggers. And, both features are available even when you not using a server (so, in 100% file based mode).

    If you using SQL server with access, then of course the stored produces are built using SQL server and not access.

    For access 2010, you open up the table (non design view), and then choose the table tab. You see options there to create store procedures and table triggers.

    http://stackoverflow.com/questions/3287545/how-do-i-make-a-stored-procedure-in-ms-access

    Sunday, September 22, 2013 12:13 PM
  • User-821857111 posted

    Yes, you can use DDL to create saved queries (which is what stored procedures are called in Access). You can pass this DDL to the CommandText property of an OleDbCommand and execute it against the database.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 22, 2013 4:56 PM