Create a stored procedure : Stored Procedure « Access « VBA / Excel / Access / Word






Create a stored procedure

 
Sub CreateStoredProc()
    Dim cmd As ADODB.Command
    Set cmd = New ADODB.Command

    cmd.ActiveConnection = CurrentProject.Connection
    cmd.CommandText = "CREATE PROCEDURE procClientGet " & _
        "(CID long) " & _
        "AS SELECT ClientID, CompanyName " & _
        "FROM tblClients " & _
        "WHERE ClientID = CID"
    cmd.Execute
End Sub

 








Related examples in the same category

1.Call store procedure
2.Use the EXECUTE statement to execute the stored procedure
3.Creating a Stored Procedure that Accepts Parameters
4.Executing a Parameterized Stored Procedure
5.Deleting a Stored Procedure
6.Executing a Stored Procedure Containing Parameters