vendredi 31 juillet 2015

Stored procedure with parameters in Access

I have this stored procedure that I run in Access.

Private Sub ReviewTrns_Click()
    Dim cdb As DAO.Database, qdf As DAO.QueryDef
        Set cdb = CurrentDb
        Set qdf = cdb.CreateQueryDef("")
        ' get .Connect property from existing ODBC linked table
        qdf.Connect = cdb.TableDefs("dbo_FreeShipping").Connect
        qdf.SQL = "EXEC dbo.UpdateTrns"
        qdf.ReturnsRecords = False
        qdf.Execute dbFailOnError
        Set qdf = Nothing
        Set cdb = Nothing
MsgBox "Records Updated!"

End Sub

It works perfectly. dbo_FreeShipping is a linked table, dbo.UpdateTrns is a stored procedure. I also want to add input value for parameter @variable1

Could it be done with message box input?

Aucun commentaire:

Enregistrer un commentaire