Re: Recordset or Object is closed HELP PLEASE!

From: mikemalachy (mikemalachy_at_yahoo.com)
Date: 06/11/04


Date: 11 Jun 2004 06:40:34 -0700

DBAL,

Are you sure that in all instances of the SQL statement, you will
actually have a resultset? I have had this problem before and it
occurred when my statement returned no data. My workaround was to
check if recordset = nothing before referencing it.

Good luck.

"DBAL" <dba@biofilm.com> wrote in message news:<1a7d201c44f04$009254f0$a601280a@phx.gbl>...
> Thanks.
> I need to find out more about how to do a Stored
> Procedure. I have done some isolation to find out what
> is causing the error. The code runs fine with a
> different query that is simpler. The main difference is
> that this query Declares Variables and Sets those
> variables to system times and dates. This is definitely
> where the problem lies. It won't return a recordset with
> a query that has Declare Statments. Or atleast that is
> what I have narrowed it down to so far. The Stored
> Procedure idea must be the only way because passing the
> SQL Server the query is giving me that error:'3704'
> Operation is not allowed when the object is closed.
>
> DBAL
>
>
>
> >-----Original Message-----
> >"DBAL" <dba@biofilm.com> wrote ...
> >
> >> Jamie, thank you for your reply.
> >> When I run the SQL in Query Analyzer it seems to run
> >> fine. I'm not sure why it wouldn't create a
> resultset.
> >> Does it not create a recordset to be returned to excel
> >> when there is definitely are query returned in Query
> >> Analzyer at the SQLSERVER? I'm not sure anymore I
> guess:
> >>
> >> Here is the SQL:
> >>
> >> <snip>
> >
> >Eek! The query from hell!
> >
> ><More politely> I have no experience of executing that
> kind of T-SQL
> >text from a client (e.g. Excel). I'd expect it to be
> wrapped in a
> >stored procedure on the server and the stored proc
> executed from the
> >client.
> >
> >Jamie.
> >
> >--
> >.
> >



Relevant Pages

  • Re: When do selects execute for multiple resultsets
    ... SQL Server executes each query and stops when its ... When the first resultset is ... The CommandTimeout is measured from the time you execute the query until the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Date Error in linked tables query
    ... Another thought: Make sure the Name AutoCorrect boxes are unchecked under: ... > Could you try it as a Pass Through query? ... Alternatively, create a View in SQL Server, and link the view? ... >> SQL Statement is at top with resulting records below, ...
    (microsoft.public.access.queries)
  • Query returns -1 if row present (DBI, SQL Server 2000)
    ... I am using the DBI module to interface with a SQL Server 2000 database ... -- connection, INSERT, UPDATE, and SELECT (when 0 rows exist in ... resultset) are fine. ... The SELECT query also runs fine in Query ...
    (comp.lang.perl.misc)
  • Re: Query returns -1 if row present (DBI, SQL Server 2000)
    ... I am using the DBI module to interface with a SQL Server 2000 database ... resultset) are fine. ... The SELECT query also runs fine in Query ... "Returns the number of rows affected by the last row affecting command, ...
    (comp.lang.perl.misc)
  • Re: Insert command not appending to table
    ... SELECT query, if you want the resultset to be in a specific order. ... example, in this case, if you have a datetime column in your table that has ... Vyas, MVP (SQL Server) ...
    (microsoft.public.sqlserver.programming)

Quantcast