[SOLVED] JvDBLookupDropDown combo's totally inactive???? lazarus / 16-Databases ---------------------------------------------------------------------- 1HuntnMan · 2026-03-23 16:58 I've been using [Jvcl DB] JvDBLookupDropDown combo's for quite awhile for forms requiring a lookup such as Country, State, Company Type, etc.  On my Clients Mgt. form, all 3 combo's have DIED!  I've looked at other forms and can't figure out what change I made to cause this.  The complete form is active, all DBEdit's are active but State/Prov.: JvDBLukUpStates, Country: JvDBLukUpCntry and same with Category are just inactive. There is test data in these fields but these components DIED!  Anyone ever have this happen or familiar with these components from JvclLazarus [Jvcl DB]? ---------------------------------------------------------------------- wp · 2026-03-23 17:17 Are the fields and datasets still properly connected? One unintentional keystroke may be sufficient to do this... ---------------------------------------------------------------------- 1HuntnMan · 2026-03-23 19:17 WP, yes everything is connected. It's just one form, Contacts Mgt. My other forms are working properly, i.e. Clients, Appointments, Proposals, Sales Orders, etc.  I broke something but haven't been able to figure it out because everything seems to be connected to the tables, in this case, Clients, Proposals, States, Categories and Countries.  The last 3 tables are just what I call lookup tables for the applications forms. Those tables are maintained separately.  I'm opening them as ReadOnly because they aren't edited on any of the main forms.  Here's a snippet from FormCreate & FormShow: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i From FormCreate...  {-------------------- Setup CATEGORIES Table query -------------------}  QryCat.Active:= False;  QryCat.DataBase:= ConnectCntks;  QryCat.Options:= [];  QryCat.SQL.Text:= 'SELECT * FROM CATEGORIES ORDER BY CATEGORY';  DSrcCat.DataSet:= QryCat;  QryCat.ReadOnly:= True;  {-------------------- Setup STPROVCODES Table query -------------------}  QryStates.DataBase:= ConnectCntks;  QryStates.Options:= [];  QryStates.SQL.Text:= 'SELECT * FROM STPROVCODES ORDER BY STPROVCODE';  DSrcStates.DataSet:= QryStates;  QryStates.ReadOnly:= True;  {--------------------- Setup COUNTRIES Table query --------------------}  QryCntries.DataBase:= ConnectCntks;  QryCntries.Options:= [];  QryCntries.SQL.Text:= 'SELECT * FROM COUNTRIES ORDER BY CODE';  DSrcCntries.DataSet:= QryCntries;  QryCntries.ReadOnly:= True; from FormShow...QryCntks.Open;QryStates.Open;QryCntries.Open;QryCat.Open: ---------------------------------------------------------------------- dseligo · 2026-03-23 23:17 Check if you get results after opening queries: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i QryCntks.Open;QryStates.Open;QryCntries.Open;QryCat.Open: // <--- you have colon here instead of semicolon ShowMessage(    QryStates.FieldByName('STPROVCODE').AsString + LineEnding +    QryCntries.FieldByName('CODE').AsString + LineEnding +    QryCat.FieldByName('CATEGORY').AsString); If you don't get data from ShowMessage, there is something wrong with your query, tables, database, ... If you get expected result (first row), then put new DBGrid component and DataSource on the form (just for test). Select Dataset in DataSource component and DataSource in DBGrid (using Object inspector). Don't change anything else. If you see data in DBGrid, then you messed something with DataSource or DBGrid. If you don't see data in DBGrid, then put that 'ShowMessage' in some button OnClick event and check if you see that first line when clicking that button. If you don't, maybe somewhere in your code you accidentally close your queries. P.S.: Now I see you write about JvDBLookupDropDown component. I don't use that component, but it should be similar to test it. I still recommend that you test with DBGrid, as I described. That way you will be sure you have the data you expect. P.S.: Now I also noticed that you set your queries to be read only. Comment this just to test it. Table that is changed with JvDBLookupDropDown component shouldn't be read only. ---------------------------------------------------------------------- 1HuntnMan · 2026-03-24 11:59 Great idea!  I'll do that and check the results.  Be back later, thanks! ---------------------------------------------------------------------- 1HuntnMan · 2026-03-24 12:31 Okay, just after opening the Contacts Mgt. Form Queries, I commented out making the 3 lookup tables, Categories, States, Countries as ReadOnly. I expected it shouldn't make a difference but good for this test. See the attachment, it's displaying the first record in each table: State=AB(Alberta), Country=AT(Austria) and Categories=Retailer. So, up to just after the tables are opened, everything good. So, I'll just keep going thru the code.  Next test is not use JvDBLookupCombo and use the Lazarus provided DBLookUp but don't expect it to make a difference. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFrmCntksMain.FormShow(Sender: TObject);begin  //=> Check the transaction...  if not TransCntks.Active then    TransCntks.StartTransaction;  //=> Check the Connections...  if not ConnectCntks.Connected then    begin      ConnectCntks.Connected:= True;      ConnectCntks.ExecuteDirect('PRAGMA busy_timeout=5000;');    ConnectCntks.ExecuteDirect('PRAGMA foreign_keys=ON;');      ConnectCntks.ExecuteDirect('PRAGMA journal_mode=WAL;');      ConnectCntks.ExecuteDirect('PRAGMA synchronous=NORMAL;');    end;  //=> Bootstrap...  QryCntks.Open;  QryCat.Open;  QryStates.Open;  QryCntries.Open;   //=> Test lookup connections...  ShowMessage(    QryStates.FieldByName('STPROVCODE').AsString + LineEnding +    QryCntries.FieldByName('CODE').AsString + LineEnding +    QryCat.FieldByName('CATEGORY').AsString);   //=> Wire next line to Sense edit/insert for Save/Cancel buttons off/on...  WireSaveCancelStateChange(Self, DSrcCntks);  if not QryCntks.IsEmpty then    UpdateTTLCntks  else    QryCntks.Append;  DBEditFName.SetFocus;end; ---------------------------------------------------------------------- 1HuntnMan · 2026-03-24 20:24 Figure it out, I had the States and Countries JvDBLookupCombo's set correctly except the one for the Category.  I had the LookupField set to the primary Auto-Inc field CATID but displaying Category field.  Lookup field set to the CATID can't populate the Category field in Contacts Table with the Category field from the Categories table. The CatID is an auto-Inc field, type Integer.  I changed it to Lookup the Category field from the Categories table, both string fields, that fixed it but I don't know why that would affect the States and Countries JvDBLookUpCombo's.  But, all is well. Thanks anyway dseligo esp. good idea to do a ShowMessage just after opening the tables to verify the Query was opening properly...