473,500 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ADO Error 3251: Current provider does not support returning multiple recordsets from a single execution?

I posted this in the MS Access group, but no luck.
------------------------------------------
I've got another stored procedure in the same app that returns multiple
recordsets and the code works.

But now I've written another SP and the code traps out with the 3251 message.

The SP is writing two recordsets.

When I run the SP in Query Analyzer, both recordsets appear.

But when I step through the code, when the first RS should be there, it's
"Closed" and nothing I've tried will make it open.
Provider=SQLOLEDB.1 (which works on the other screen...)

Seems like I've been here before, but I can't remember what the problem was.
--
PeteCresswell
Jul 20 '05 #1
7 16471
(Pete Cresswell) (x@y.z) writes:
I posted this in the MS Access group, but no luck.
------------------------------------------
I've got another stored procedure in the same app that returns multiple
recordsets and the code works.

But now I've written another SP and the code traps out with the 3251
message.

The SP is writing two recordsets.

When I run the SP in Query Analyzer, both recordsets appear.

But when I step through the code, when the first RS should be there, it's
"Closed" and nothing I've tried will make it open.


That is likely to be a rowcount from an INSERT into a temp table or
something like that. Step to next with .NextRecordset. Or use SET
NOCOUNT ON.

I don't think you can have multiple record sets with all settings.
But if you stick to client-side cursors, this should not be a problem.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
RE/
That is likely to be a rowcount from an INSERT into a temp table or
something like that. Step to next with .NextRecordset. Or use SET
NOCOUNT ON.


That was my first suspicion too...but it *looks* like I've got my NOCOUNT
settings in the right place.

If not, shouldn't the extraneous recordsets show up when I execute the procedure
under Query Analyzer?
--
PeteCresswell
Jul 20 '05 #3
RE/
NOCOUNT


Then I jumped to the conclusion that maybe there was some kind of runtime error
in the query that I wasn't trapping....but I kept coming back to the fact that
everything looks a-ok when the query runs in Query Analyzer....and the
..CursorType is defaulted - the same as it is in a similar multi-recordset query
that works.
--
PeteCresswell
Jul 20 '05 #4
RE/
same as it is in a similar multi-recordset query
that works.


One thing I notice in Query Analyzer is that when I toggle "Display Estimated
Execution Plan" on and off, the following error is thrown:
-------------------
Server: Msg 208, Level 16, State 1, Procedure spEstimate_Load, Line 139
Invalid object name '#Extract1'.
-------------------

But, as noted before, we see apparently-good output when the SP executes.

Also, the same error pops when the other procedure (the similar one that
works...) is up in Query Analyzer and "Display Estimated Execution Plan" is
toggled.
--
PeteCresswell
Jul 20 '05 #5
RE/
no luck.


Bingo!

I was summing the contents of a #Temp table to coalesce some of the columns.

When I defined the table, I failed to specify DEFAULT 0 for the numeric fields.

Somehow, the Sum() statements worked when running under Query Analyzer, but
created 2 Closed/empty recordsets running from VBA/ADO.
--
PeteCresswell
Jul 20 '05 #6
(Pete Cresswell) (x@y.z) writes:
One thing I notice in Query Analyzer is that when I toggle "Display
Estimated Execution Plan" on and off, the following error is thrown:
-------------------
Server: Msg 208, Level 16, State 1, Procedure spEstimate_Load, Line 139
Invalid object name '#Extract1'.
-------------------


I would guess this is due to that when you use "Estimatade plan", QA runs
the query with SET FMTONLY ON. With this setting, SQL Server traverses
the batch, without executing the statements with one exception: it
enters stored procedures. You get this error, because it does not create
the temp table which appears further down in the procedure.

Now, there are situations where ADO can start to run queries with SET
FMTONLY ON. I've seen this happen if you call your stored procedure
with ODBC syntax and a .CommandType of adCmdText. Use adCmdStoredProcedure
instead.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #7
(Pete Cresswell) (x@y.z) writes:
I was summing the contents of a #Temp table to coalesce some of the
columns.

When I defined the table, I failed to specify DEFAULT 0 for the numeric
fields.

Somehow, the Sum() statements worked when running under Query Analyzer,
but created 2 Closed/empty recordsets running from VBA/ADO.


Hm, could that be because of the ANSI warnings for eliminating the
NULL values? Run the query from QA in text mode, and be sure to have
ANSI_WARNINGS ON, and you will see what I mean. (You will have to remove
the default of course.)
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3454
by: (Pete Cresswell) | last post by:
I've got another stored procedure in the same app that returns multiple recordsets and the code works. But now I've written another SP and the code traps out with the 3251 message. The SP is...
6
4710
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
15
5298
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
6
4938
by: Chris Love | last post by:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not...
1
9418
by: ydprasad | last post by:
I am trying to convert the code that was written in VB using DAO to ADO. But when i tried to do following getting an error '3251'. *************code************************** Dim cn As New...
6
9648
by: akoymakoy | last post by:
Run time error 3251 Current Recordset does not support updating, this may be a limitation of the provider, or of the selected Locktype This is my simple program that will split the entries that...
3
616
by: amatuer | last post by:
ADODB.Recordset error '800a0cb3' Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype. /devag/newProjSave.asp, line 321 ...
3
13337
by: Ted | last post by:
In WSAT, I get the following error when trying to set up my provider: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site...
2
4188
by: slinky | last post by:
I'm getting a error when I open my . aspx in my browser... line 34: da.Fill(ds, "Assets") Here's the error and my entire code for this .aspx.vb is below that ... I need some clues as to what is...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
316
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.