Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!
Private Sub cmdProc_Click() Dim rst As ADODB.Recordset Dim cmd As ADODB.Command Dim stProcName As String 'Stored Procedure name Dim cnt As ADODB.Connection 'Declare variables for Stored Procedure Dim myVariable As Variant Dim myReturn As String 'Set ADODB requirements Set rst = New ADODB.Recordset Set cmd = New ADODB.Command ' Defines the stored procedure commands stProcName = "Staff_Login" 'Define name of Stored Procedure to execute." cmd.CommandType = adCmdStoredProc 'Define the ADODB command cmd.ActiveConnection = CurrentProject.Connection 'Set the command connection string cmd.CommandText = stProcName 'Define Stored Procedure to run 'Execute stored procedure and return to a recordset Set rst = cmd.Execute() 'myReturn = rst.Fields("procedure_name").Value myReturn = rst.Fields("StaffID").Value 'Call Sub-Routine_That_Uses_The_Returned_Data MsgBox (myReturn) 'Close database connection and clean up If CBool(rst.State And adStateOpen) = True Then rst.Close Set rst = Nothing If CBool(cnt.State And adStateOpen) = True Then cnt.Close Set cnt = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|MS Access VBA How To Decompress a Gzip Response From a HTTP Request||4||28|
|Returning Message/Value Back to Access from a SQL Server trigger||3||34|
|SQL Distinct Question||3||14|
|How can I set my Access Query up to filter out specific records||13||22|