Re: SQL 2000 Stored Procedure Problem
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sun, 27 May 2007 09:02:31 +0000 (UTC)
Richard (rich@xxxxxxxxxxxxxxxx) writes:
******** The error trap in the VB app is raised on any reference to the
recordset (Operation is not allowed when object is closed).
objRsDetails.MoveFirst triggers it. "If objRsDetails.EOF" triggers it.
That's why I looked at objRsDetails.State after the Open - it = 0 (Closed)
- so the open fails!
No, that just means that the first recordset you get is a rowcount from
the INSERT. Use .NextRecordset to proceed to the next. Or issue SET
NOCOUNT ON in your procedure.
******** Server1 (older) does use linked servers since that's where the
web site resides and it has to read from either Server - it works
fine. Ultimately Server1 is going away - and the linked server will no
longer be needed. But this problem app does not use it - it is just a
Reports App and the server that has the app will always be the same
server that has their SQL Server and Database. The full
"IP.DBName.[dbo]" is simply used to make it easier to manage since the
IP and DB are in a Setup Table that depending on the customer the IP
"may" be different and the DBName will always be different.
So on the old server where things work, you connect to one server, and
then issue a call stored procedure on a second server through the first
server? But on the server you are having problems with, the IP address
is the same as the server you connect to, so that you have a loopback?
This could explain why it works on the first server: the rowcount is
consumed by the server you connect to, and does not reach your client.
Whereas in the second case SQL Server is smart enough to shortcut,
and there is not really any linked server, so it is a direct call to
the procedure.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: SQL 2000 Stored Procedure Problem
- From: Erland Sommarskog
- Re: SQL 2000 Stored Procedure Problem
- References:
- SQL 2000 Stored Procedure Problem
- From: Richard
- Re: SQL 2000 Stored Procedure Problem
- From: Russell Fields
- Re: SQL 2000 Stored Procedure Problem
- From: Richard
- Re: SQL 2000 Stored Procedure Problem
- From: Erland Sommarskog
- Re: SQL 2000 Stored Procedure Problem
- From: Richard
- Re: SQL 2000 Stored Procedure Problem
- From: Russell Fields
- Re: SQL 2000 Stored Procedure Problem
- From: Richard
- Re: SQL 2000 Stored Procedure Problem
- From: Richard
- Re: SQL 2000 Stored Procedure Problem
- From: Erland Sommarskog
- Re: SQL 2000 Stored Procedure Problem
- From: Richard
- SQL 2000 Stored Procedure Problem
- Prev by Date: Re: SQL 2000 Stored Procedure Problem
- Next by Date: Re: Custom Database Roles -- Insert
- Previous by thread: Re: SQL 2000 Stored Procedure Problem
- Next by thread: Re: SQL 2000 Stored Procedure Problem
- Index(es):
Relevant Pages
|
|