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!

Resultset from sp

Status
Not open for further replies.

simma

Programmer
Sep 11, 2001
398
US
Hello,
I used stored procedure with parameter from form..I do not see the resultset when executed..
can we display the results just like int query or i need report to display results?

I used the following code
Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rec As New ADODB.Recordset
Dim amount As Integer
txtAmount.SetFocus
amount = txtAmount.Text
Dim param1 As Parameter, param2 As Parameter, param3 As Parameter
Dim param4 As Parameter, param5 As Parameter
Set cnn = CurrentProject.Connection
Set cmd.ActiveConnection = cnn
cmd.CommandText = "dbo.p_amount_search"
cmd.CommandType = adCmdStoredProc
Set param1 = cmd.CreateParameter("amount", adInteger, adParamInput)
cmd.Parameters.Append param1
param1.Value = amount
Set rec = cmd.Execute

Thanks
 
You can use either a Form or Report to display the resultset. The later versions of Access give more capability in displaying the results, but you should be able to use the stored procedure directly as the recordsource in the Form or Report. There is also a parameter property under the data tab.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top