Hi folks. I'm trying to write a CGI app that will grab values from MS SQL Server 6.5 (using ADO, not BDE) and spit out the results to a browser as part of a larger project (w/ Delphi 5 Pro). However, I've come across a stupid problem.

SQL Server seems to handle the recordcount differently than Oracle, which I usually use. When I execute a query that's guaranteed to give no results, it blows up! Instead of letting me check the recordcount, it immediately (at the "MyQuery.Open" line, executing a simple select statement) throws back a server error:

Exception: EOleException
Message: Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record
This only happens if no record is returned.

I'd really prefer to be able to check the recordcount ("if myquery.RecordCount = 0 then DoSomething") after running the query! At present, it looks like I may have to use try..except to catch this, which seems very kludgey! Does anyone have an inkling of what's going on here? How do I accurately run a select query that may not return anything without it blowing up? What am I doing wrong here? :evil: