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!

Ouput Parameters with InputParameters

Status
Not open for further replies.

EriRobert

MIS
May 9, 2003
114
GB
Hello,

It is possible to use the InputParameters property to pass back OUTPUT parameters (as well as the returned recordset)?

I've tried:

@intINPUT int = Forms!Form1!intCode,
@vchOUTPUT varchar = Forms!Form1!vchOUT OUTPUT

but it seems to ignore the OUTPUT statement against the second parameter and the form control vchOUT is empty. The recordset is correctly returned.

Any ideas?
 
A stored procedure can return an output parameter to a variable. You have to assign the variable to a textbox. The output variable is not accessible until you close the recordset (or, in some cases move to the next recordset)

If you have access to SQL Books Online, search for the following:
Using Return Code and Output Parameters for Stored Procedures
 
Hello Neecie,

I do know how to return OUTPUT parameters from a stored procedure when I am in control - through my coding. However here I am using the stored procedure as a 'Record Source' on a continuous form and using the associated property 'Input Parameters' to pass parameters to the stored procedure.

In this case the stored procedure, in addition to returning the recordset, returns output parameters. As you say the output parameter is not available until the recordset is closed - when in a record source / input parameters scenario is the record set closed and the parmeter available?

Any ideas? - Perhaps the property title - Input Parameters' suggests Output parameters cannot be processed?
 
I guess I am not quite catching on to what you are trying to accomplish.
There are some examples in the SQL BOL for returning recordsets and output params.
But if you are trying to get the output param into the inputparam property of a form, I do not think it is possible

(although there is probably someone somewhere that has found a work-around - but this is beyond my limited capability!)

neecie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top