Function StoredProc(Sqlstr As String, ByRef OUTPUTvar As Variant, ParamArray PramsIn()) As Integer
Dim PramsInCnt As Integer
Dim RecoredAffected As Long
Dim Cnt As Integer
If cnn.State = adStateClosed Then
InitializeADO
End If
cmd.ActiveConnection = cnn
cmd.CommandTimeout = 0
cmd.CommandText = Sqlstr
cmd.CommandType = adCmdStoredProc
For Cnt = 0 To cmd.Parameters.Count - 1
If cmd(Cnt).Direction = adParamInput Or cmd(Cnt).Direction = adParamInputOutput Then
cmd(Cnt).Value = PramsIn(PramsInCnt)
PramsInCnt = PramsInCnt + 1
End If
Next Cnt
cmd.Execute a
ExecuteAdoQuery1 = RecoredAffected
OUTPUTvar = cmd
Set cmd = Nothing
End Function
Sub ExecStoredProc()
a = StoredProc("CanOpenPaymentPlans", s, 4311)
End Sub
Alter Procedure CanOpenPaymentPlans
@custid int,
@CanOpen bit output,
@HasPaymentPlans bit output,
@Disconnectionid int output,
@reason varchar(100) output
As
declare @TodaysAllowArrangementDays datetime
even though my Parameters are declared as output ado interperts it as a inputout what can i do
Dim PramsInCnt As Integer
Dim RecoredAffected As Long
Dim Cnt As Integer
If cnn.State = adStateClosed Then
InitializeADO
End If
cmd.ActiveConnection = cnn
cmd.CommandTimeout = 0
cmd.CommandText = Sqlstr
cmd.CommandType = adCmdStoredProc
For Cnt = 0 To cmd.Parameters.Count - 1
If cmd(Cnt).Direction = adParamInput Or cmd(Cnt).Direction = adParamInputOutput Then
cmd(Cnt).Value = PramsIn(PramsInCnt)
PramsInCnt = PramsInCnt + 1
End If
Next Cnt
cmd.Execute a
ExecuteAdoQuery1 = RecoredAffected
OUTPUTvar = cmd
Set cmd = Nothing
End Function
Sub ExecStoredProc()
a = StoredProc("CanOpenPaymentPlans", s, 4311)
End Sub
Alter Procedure CanOpenPaymentPlans
@custid int,
@CanOpen bit output,
@HasPaymentPlans bit output,
@Disconnectionid int output,
@reason varchar(100) output
As
declare @TodaysAllowArrangementDays datetime
even though my Parameters are declared as output ado interperts it as a inputout what can i do