Reputation: 21
I have a process where the user goes into an Access database and processes data and when that is finished, the Access process sends an Outlook email to me every time. Is there a way that the Access database can kick off a SQL Server Agent Job or when I get that Outlook email, I can trigger the job?
Thank you!
Upvotes: 0
Views: 313
Reputation: 20342
Maybe this?
Option Compare Database
Private Sub Command0_Click()
Call runStoredProcfromAccess
End Sub
Sub runStoredProcfromAccess()
Dim cmd As New ADODB.Command, RS As New ADODB.Recordset, strSql As String
Dim i As Integer, j As Integer
cmd.ActiveConnection = "Provider=SQLOLEDB;Data Source=your_server_name;Database=your_database_name;Trusted_Connection=Yes;"
cmd.ActiveConnection.CursorLocation = adUseClient
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "dbo.CustOrderHist"
cmd.Parameters("@CustomerID").Value = "ALFKI"
Set RS = cmd.Execute
Debug.Print RS(0)
RS.Close
cmd.ActiveConnection.Close
End Sub
Upvotes: 1