?
Solved

ADOQuery Select Statement with no result

Posted on 2003-03-17
2
Medium Priority
?
844 Views
Last Modified: 2007-12-19
When i write for example:
ADOQuery->SQL->Clear();
ADOQuery->SQL->ADD(select * from TABLE_NAME;")
ADOQuery->Open();
my aplication is working fine. There is a set o records witch is returned from the SQL Server to my aplication.

The problem appears when executing select statement on the Server returns no result, for example
select *
from MONTHS
where MONTH_NUMBER=13;
Of corse this statement returns 0 rows.

Then if I try to exec another select statement (that returns some rows this time) I have this:

" Eof or Bof are set to true or Current Record have been deleted. This operation requires current record"

My application is going crush :(
Even command ADOQuery->Close() cases this error.
Of corse if no set of rows was returned by SQL select statement,bof and eof are set to true, and I can't
have current record.
But why i can't use this ADOQuery component to another SQL select statemnets and work with any problem?

I'm not very expirienced in database-appliacation programming and this is serious problem for me.
If You know answer for my question, please help me.
Thank You very much
0
Comment
Question by:Lopcio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
nigelrivett earned 100 total points
ID: 8152043
Try an exec rather than open for those queries that don't return resultsets.

Also try removing the reference to the resultset rather than closing it.
0
 
LVL 9

Expert Comment

by:xenon_je
ID: 8152399
Before using it for another query you must first close it.
the ADOQuery->Close should not create any error, maybe you left some code in there that creates the error.....
at least this is my opinion....take a better look there
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

765 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