mattster1010
03-25-2011, 04:22 AM
Morning All,
I'm using the below vba code to pass parameters to a stored procedure called "Local_Send_Doc":
'Dim Cmd1 As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim intTemp As Integer
Set Cmd1 = New ADODB.Command
Cmd1.ActiveConnection = cn
Cmd1.CommandText = "Local_Send_Doc"
Cmd1.CommandType = adCmdStoredProc
Cmd1.Parameters.Refresh
Cmd1.Parameters("@USERID").Value = "smithm"
Cmd1.Parameters("@INVNUMB").Value = "OP/I976893"
Cmd1.Parameters("@TYPE").Value = "Invoice"
Set rs = Cmd1.Execute()
It throws up a type mismatch error on the line highlighted in red. Can anyone see any obvious problems with the code?
Regards,
Mattster
I'm using the below vba code to pass parameters to a stored procedure called "Local_Send_Doc":
'Dim Cmd1 As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim intTemp As Integer
Set Cmd1 = New ADODB.Command
Cmd1.ActiveConnection = cn
Cmd1.CommandText = "Local_Send_Doc"
Cmd1.CommandType = adCmdStoredProc
Cmd1.Parameters.Refresh
Cmd1.Parameters("@USERID").Value = "smithm"
Cmd1.Parameters("@INVNUMB").Value = "OP/I976893"
Cmd1.Parameters("@TYPE").Value = "Invoice"
Set rs = Cmd1.Execute()
It throws up a type mismatch error on the line highlighted in red. Can anyone see any obvious problems with the code?
Regards,
Mattster