Apocalypse
Programmer
ppl,
I have the following code to pass a 8-digit ID to a stored procedure that returns all records containing that ID:
' Setup first parameter
sParmName = "Return"
Set sp_Parameter = sp_Command.CreateParameter(sParmName, adInteger, adParamReturnValue, , 0)
sp_Command.Parameters.Append sp_Parameter
sp_Command.Parameters(sParmName).Value = -1
' Setup second parameter
sParmName = "Cab_ID"
Set sp_Parameter = sp_Command.CreateParameter(sParmName, adNumeric, adParamInput)
sp_Command.Parameters.Append sp_Parameter
sp_Command.Parameters(sParmName).Value = txtWhere.Text
Set sp_RecordSet = sp_Command.Execute
Set DataGrid1.DataSource = sp_RecordSet
The problem is the parameter does not get passed to the stored procedure so it keeps returning the whole recordset.
What am I doing wrong? [sig][/sig]
I have the following code to pass a 8-digit ID to a stored procedure that returns all records containing that ID:
' Setup first parameter
sParmName = "Return"
Set sp_Parameter = sp_Command.CreateParameter(sParmName, adInteger, adParamReturnValue, , 0)
sp_Command.Parameters.Append sp_Parameter
sp_Command.Parameters(sParmName).Value = -1
' Setup second parameter
sParmName = "Cab_ID"
Set sp_Parameter = sp_Command.CreateParameter(sParmName, adNumeric, adParamInput)
sp_Command.Parameters.Append sp_Parameter
sp_Command.Parameters(sParmName).Value = txtWhere.Text
Set sp_RecordSet = sp_Command.Execute
Set DataGrid1.DataSource = sp_RecordSet
The problem is the parameter does not get passed to the stored procedure so it keeps returning the whole recordset.
What am I doing wrong? [sig][/sig]