Solved

Closed dataset error

Posted on 2006-07-19
4
898 Views
Last Modified: 2012-06-21
Everytime I use the SalesLogix client to connect to the database I get a "Cannot perform this operation on a closed dataset"

Any ideas on how to get the client to connect to the database.

We are using Windows 2000 server and SQL 2000

0
Comment
Question by:pbraden
  • 2
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
ID: 17139019
Hi pbraden,

This is probably the Set NOCOUNT OFF issue. If you have a complex stored procedure which performs more than a single select, you may get more than one dataset result returned. These results contain the messages that you would normally see in query analyzer and not the data you expect to see (well one of the datasets returned does, just not necessarily the first).

There are basically two ways to resolve the issue, either from your client you need to use .NextRecordset or .NextResult or whatever equivalent method is available in your client. Or you change the stored procedure that you are calling and add "SET NOCOUNT OFF" before the code that is executed in the SP. This latter option suppresses these messages and allows the data to be returned in the first resultset.

Tim Cottee
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17140372
Tim,

>>Or you change the stored procedure that you are calling and add "SET NOCOUNT OFF" <<
I think you mean SET NOCOUNT ON.  Otherwise we have the default and messages will be displayed.  It is after all a double-negative :)
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 17142250
acperkins, it was hot and minutes before I was leaving work. That's my excuse anyway, the thought was there.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17143352
>>That's my excuse anyway, the thought was there.<<
Most definitely, did not mean to steal your thunder, I just wish Microsoft had called it SET COUNT OFF :)

Anthony
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
where to find DTS instalation package for sql 2014 64 bit 3 10
SQL Quer 4 21
SQL Syntax Grouping Sum question 7 24
Where is the Help Section? 8 26
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question