K
kiloez
What's the best way to run a stored procedure from code in a Access project?
I'm currently passing a string to the rst.open method, using something like
this:
Dim strSSN As String
Dim rst As ADODB.Recordset
Dim strSproc As String
strSSN = InputBox("Please enter SSN to search", "Client Search")
strSproc = "execute dbo.spGetClientBySSN " & "'" & strSSN & "'"
Set rst = New ADODB.Recordset
rst.Open strSproc, CurrentProject.Connection
It works just fine, but I'm wondering if there is a better way.
I'm currently passing a string to the rst.open method, using something like
this:
Dim strSSN As String
Dim rst As ADODB.Recordset
Dim strSproc As String
strSSN = InputBox("Please enter SSN to search", "Client Search")
strSproc = "execute dbo.spGetClientBySSN " & "'" & strSSN & "'"
Set rst = New ADODB.Recordset
rst.Open strSproc, CurrentProject.Connection
It works just fine, but I'm wondering if there is a better way.