BUG: A stored procedure that fetches a cursor may fail to run in Microsoft Access project (818100)
The information in this article applies to:
- Microsoft Access 2002
- Microsoft Access 2000
Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMSWhen you run a stored procedure in Access project and that
stored procedure creates and fetches a cursor, the stored procedure may fail.
You may receive the following error messages:
STATUS Microsoft
has confirmed that this is a problem in the Microsoft products that are listed
at the beginning of this article.
WORKAROUNDTo work around the problem, use one of the following
methods: Method 1- You can change the stored procedure to assign the result of
the FETCH statement to a variable. For example, the original stored
procedure may look similar to this:
CREATE PROCEDURE test1
AS
DECLARE cc1 CURSOR FOR SELECT c1 FROM t1
OPEN cc1
FETCH cc1
CLOSE cc1
DEALLOCATE cc1
- You can use the following code sample to change the stored
procedure to fetch the result of the FETCH statement to a variable.
ALTER PROCEDURE test1
AS
DECLARE @ID int
DECLARE cc1 CURSOR FOR SELECT c1 FROM t1
OPEN cc1
FETCH cc1 INTO @ID
CLOSE cc1
DEALLOCATE cc1
Method 2You can use any of the following ways to run the stored procedure:
- SQL Query Analyzer
- SQL Pass-Through query
- VBA environment by means of ActiveX Data Objects
(ADO)
Modification Type: | Minor | Last Reviewed: | 8/6/2004 |
---|
Keywords: | kbBug kbDatabase kbTSQL kberrmsg KB818100 kbAudDeveloper |
---|
|