Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Very strange

Status
Not open for further replies.

ndevriendt

Programmer
Jan 8, 2002
74
BE
Hello,

I want to use a query multiple times.
I'm using Microsoft SQL Server 2000 as database.
The ADOMenus object is located in a DATA MODULE.
When I set a ADO Query on my form I have no error when I
set active property on false.

I use the following code:


if ADOMenus.active then ADOMenus.active := false;
ADOMenus.SQL.Text := SQLString;
ADOMenus.active := true;

SQL string contains a simple select statement.
He gives me the following error on the line adomenus.active := false;
I receive only the following
message when there are no records in adomenus.

'Project GMS.exe raised exception class EOleException with
message 'Either BOF of EOF is True, or the current record
has been deleted. Requested operation requires a current record'. Process stopped£. Use Step or Run to continue'.

Can somebody explain this error.

Thanks for your time and answer

Devriendt Nico
 
Try this instead:

if ADOMenus.active then ADOMenus.active := false;
ADOMenus.SQL.Add(SQLString);
ADOMenus.active := true;

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
If you are going to use "SQL.add", then I think you must use "SQL.clear" first.

A typical bit of code from one of my apps is:

Code:
  with quFind do begin
     if active then close;
     SQL.clear;
     SQL.add('SELECT * Date FROM PurchContactSheet ');
     SQL.add('WHERE  Address_ID = :Address_ID');
     Parameters.ParamByname('Address_ID').value:= FAddress_ID;
     open;
  end;

Peter Tickler

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top