SQLite: Get field names from table lazarus / 16-Databases ---------------------------------------------------------------------- Milsa · 2021-09-27 17:54 I have this fragment of code: 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     SQL.Text := Format('SELECT * FROM [%s]', [Name]);    Open;    while not EOF do    begin      //detecting field names      Next;    end;  Close;      Can I detect field names from TSQLQuery like "Fields[0].Name"? ---------------------------------------------------------------------- dseligo · 2021-09-28 05:49 This works with ZEOSlib: 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 For i:=0 to Fields.Count-1 do  showMessage(Fields[i].FieldName); ---------------------------------------------------------------------- Zvoni · 2021-09-28 06:39 Use "GetFieldNames" of TSQLite3Connection of TSQLConnection (SQLite3Connection inherits from it) --> TSQLite3Connection overrides the one from TSQLConnection https://www.freepascal.org/daily/packages/fcl- db/sqlite3conn/tsqlite3connection.getfieldnames.html https://www.freepascal.org/docs- html/fcl/sqldb/tsqlconnection.getfieldnames.html EDIT: Alternative is to fire a PRAGMA-Call from a TSQLQuery-Object 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 MySQLQuery.SQL.Text:='PRAGMA table_info(MyTableName)';MySQLQuery.Open; ---------------------------------------------------------------------- Milsa · 2021-10-02 11:40 Thank you very much. This is solution for me.