Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error In ADO Parameters Direction

Status
Not open for further replies.

PWise

Programmer
Dec 12, 2002
2,633
US
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
 
ADO treats output parmeters as input/output. If you have a parameter count and can check how many are input then the rest are output, or if it's not input it's output.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top