Troubleshooting

graphics/troubleshooting.gif

Stored Procedures Don't Return the Expected Recordset

My SELECT * FROM TableName statement at the end of a stored procedure that includes INSERT [INTO], UPDATE, or DELETE statements doesn't return any rows.

You forgot to add SET NOCOUNT ON as the first statement of your procedure. T-SQL and VBA can handle combinations of multiple return values and Recordsets from a stored procedure, but ADP can't. If you don't add SET NOCOUNT ON, the server returns the number of records affected for each operation, which generates an unneeded data transfer from the server to the client. In the case of the spCategoriesCT procedure, the server returns 10 values before sending the Recordset. Unless you're using VBA code to execute the query and need the RecordsAffected values returned after execution, always make SET NOCOUNT ON the first statement of your stored procedures.



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net