I'm trying to execute a stored procedure from within an erp system that offers vba as a means to manage simple customizations. The stored procedure doesn't require me to pass any parameters just execute it.
I have a general working knowledge of vba but not enough sophistication to figure this one out so any help is greatly appreciated.
When I run the vba code I receive the following message:
'Operation is not allowed when the object is closed'
Private Sub AutoApply_Changed()
Dim l_pRS As ADODB.Recordset
Dim l_pConnection As ADODB.Connection
Dim strSQL As String
On Error GoTo EH:
Set l_pConnection = UserInfoGet.CreateADOConnection
l_pConnection.DefaultDatabase = UserInfoGet.IntercompanyID
Set l_pRS = New ADODB.Recordset
strSQL = ""
strSQL = "EXEC dbo.BC_CashReceiptsAutoApply"
l_pRS.Open strSQL, _
MsgBox "The following error has occurred: " & Err.Description
Any ideas on how to resolve this?
View Complete Post