Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-08-21 : 14:39:29
|
| Matt Law writes "Hi,Firslty, appologies to anyone who thinks this is a stupid question, but...I've got a stored procedure in SQL7 that I want to use to return 2 output parameters and a recordset.The reason for this is I've got a server-side paging script. It runs a query and returns back only page 'n' etc. However, I wanted to return back the number of pages and records founds in the output parameters as well as the search results in a recordset. Useful information for the ASP script to use in the display.Now, my problem arrises when I try to do both.I can comfotably get it to show me the recordset but no output parameters. Or I can get it to give me the output parameters but no recordset.I've followed about 10 examples and none of them work when used on my system. The command object just doesn't want to return both.. Here is my ADO code: (Its standard stuff) objCmd.ActiveConnection = myDSN objCmd.commandText = "sp_pagedItems" objCmd.CommandType = adCmdStoredProc objCmd.Parameters.Append objCmd.CreateParameter("@page",adInteger,adParamInput,,0) objCmd.Parameters.Append objCmd.CreateParameter("@recsPerPage",adInteger,adParamInput,,10) objCmd.Parameters.Append objCmd.CreateParameter("@Search1",adVarChar,adParamInput,15,null) objCmd.Parameters.Append objCmd.CreateParameter("@Search2",adVarChar,adParamInput,15,null) objCmd.Parameters.Append objCmd.CreateParameter("@output",adInteger,adParamInput,,4) objCmd.Parameters.Append objCmd.CreateParameter("@pagesFound",adInteger,adParamOutput,,0) objCmd.Parameters.Append objCmd.CreateParameter("@recordsFound",adInteger,adParamOutput,,0) set rs = objCmd.Execute Response.Write "+" & objCmd.Parameters("@pagesFound") Response.Write "+" & objCmd.Parameters("@recordsFound")----------------------------------------------------------Many thanks in advance,Matt Law" |
|
|
|
|
|
|
|