Board index » delphi » Stored procedure works but recordset is closed....

Stored procedure works but recordset is closed....

I am using MS SQL 2k.
I've been using a stored procedure for weeks and all of a sudded when I
execute and I get a recordset back from it, the recordset is closed.
The code is as simple as

conn := CoConnection.Create;
conn.Open('Provider=SQLOLEDB.1;User ID=sa;Initial Catalog=FileSafe;Data
Source=myserver','','',0);
rs := conn.Execute('EXEC GetDirectoryFiles ''ARCHIVE'', ''$ROOT''', ra,
adCmdText);
showmessage(INtToSTr(rs.recordcount));

Nothing fancy.
When I execute the stored procedure inside the Query Analyzer I get my
records back as expected.

As soon as I try to get the recordcount I get an "Operation not allowed when
the object is closed".
The same happens if I create a recordset and try to retrieve the records
using that.

Any help is greately appreciated

--
Alessandro Federici

eCubix System Architect
Borland Certified Developer

http://www.msdelphi.com
a...@bigfoot.com

 

Re:Stored procedure works but recordset is closed....


Quote
"Alessandro Federici" <a...@bigfoot.com> wrote in message

news:3bfdd873$1_2@dnews...

GOT IT!
I left a PRINT statement on another procedure that was being referenced by
the one I was calling...

Other Threads