Subject ISC_ERROR 335544652 multiple rows in singleton select
Author w1n9man
Hi,

I have read the previous post on this and it does not make sense.
Here is the code I am using:

if(EdPass->Text == IntToStr(id))
{
if(on == 0)
{
DataMod->Working->Active = true;
DataMod->Working->Insert();
DataMod->Working->FieldByName("UID")->AsInteger = uid;
DataMod->Working->FieldByName("START")->AsDateTime = Now();
DataMod->Working->FieldByName("ONDATE")->AsDateTime = Date() ;
DataMod->Working->Post();
TLocateOptions opts;
DataMod->Users->Locate("ID",uid, opts);
DataMod->Users->Edit();
DataMod->Users->FieldByName("WORKING")->AsInteger = 1;
DataMod->Users->Post();
Form1->newsale = false;
Close();
}
else -------------------All above the line works perfectly-------
{
DataMod->Working->Active = true;
// DataMod->Working->First(); <---Always here when uncommented
while(! DataMod->Working->Eof)
{
if(DataMod->Working->FieldByName("UID")->AsInteger == uid)
{
DataMod->Working->Edit();
DataMod->Working->FieldByName("FINISH")->AsDateTime =
Now();
DataMod->Working->Post();
DataMod->Working->Active = false;
//TLocateOptions opts;
//DataMod->Users->Locate("ID",uid, opts); <-error here
//DataMod->Users->Edit();
//DataMod->Users->FieldByName("WORKING")->AsInteger = 0;
//DataMod->Users->Post(); <--- Sometimes here
Form1->newsale = false;
Close();
}
else
{
DataMod->Working->Next(); <--Never Here
}
}
}
}
else

This started out as a problem with Locate, but is is inconsistent,
the Locate for the upper portion of code works but not for the lower
and it has now started happening on selecting First() and on Post().
What I cannot understand is why the code in the upper potion works
and not for the lower protion. I have cheched the value of uid to make
sure it is being passed correctly and have checked opts to make sure
that it is empty. I have tried iterating through the items myself and
I have even resorted to placing the update for the Users table into an
after update trigger for Working - but even if the error does not show
up, the update does not happen and the trigger never fires. This is
really starting to bug me now and I have spent over a week just trying
to change a flag and add a time, and if I don't get it sorted soon I
am going to have to abandon Firebird in favour of MSDE.
Is this a problem with the table, IBO or Firebird in general?
-- STOP PRESS -----
I was just checking something using IBO Console and guess what ?
ISC_ERROR 335544652 from IBO Console !!

Can someone please tell me what is the problem here or at least point
me in the right direction?

Thanks

Trevor