Solved

Closed dataset error

Posted on 2006-07-19
4
891 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now