Subject Preparing a TIB_Query throws a 'COL is a required field" error
Author tickerboo2002
Using IBO v4.8.7 with BCB2006 and I'm experiencing a weird problem at a customer site (works fine for me). Here's the ghist of my code:



if ( CallWasPreviouslySaved )
{
qryAddCall->Prepare();
qryAddCall->ParamByName("CALL_ID")->AsInteger = pCall->CallID_DB;
qryAddCall->Open();
}
else
{
qryAddCall->Prepare(); <-----
qryAddCall->Insert();
}

I'm using prepared edits/inserts and when I call Prepare (prior to Insert) I get an exception being thrown 'CONTACT_ID is a required field'. The CONTACT_ID column is a not NULL column of the table.

Whenever I test this here, it works with no issues. However, on a customer site, they always get the exception being thrown when 'Prepare' is called. I can imagine this error being thrown when I go to Post/Commit data, but not when performing a Prepare.

Can anyone cast any light on why/how this could be happening and are there any properties of the TIB_Query that could be causing this?

Many thanks.