Postgres Database issue - field not found lazarus / 16-Databases ---------------------------------------------------------------------- timcs · 2013-12-27 09:56 Hi   I am starting to run some tests on the postgres connections before using this with a program I wrote using the DBF component. Currently my program consists of two SQLquerys,TPQconnection,Datasource and TSQLConnection.   One set is used to just make connections to the database and tables and the other is used for created and updated records.  My first problem is that the SQLquery I am using to first display a record, I then retrieve a field value from this, clear the SQL and set active to false, I then have even set the TPQconnection to false while I add a new SQL to just read in one table and find a record. My problem is when the SQLquery is set to active (along with the TPQconnection) as it is stated that a field is not found. However even if my SQL select statement is specific to a particular field, this error still comes up with the same field. Any ideas why? Thanks TimCS ---------------------------------------------------------------------- BigChimp · 2013-12-27 10:11 Don't use an SQLConnection - you already have a TPQConnection. I strongly suspect you're not using DBF components. If you are, you're using DBF files??!? QuoteOne set is used to just make connections to the database and tables and the other is used for created and updated records.Very strange. If one set is used just to make connection, what does it do? You're probably specifying the wrong field in your SQL!?!? Note that you can check what fields the db components sees in design mode: http://wiki.lazarus.freepascal.org/Database_metadata#Lazarus_TSQLQuery _metadata_tool and http://wiki.lazarus.freepascal.org/Working_With_TSQLQuery#Running_your _own_SQL_and_getting_metadata Can't say much more given your usual lack of detailed info (version numbers etc even) ---------------------------------------------------------------------- timcs · 2013-12-27 10:24 Quote from: BigChimp on December 27, 2013, 11:11:32 amDon't use an SQLConnection - you already have a TPQConnection. I strongly suspect you're not using DBF components. If you are, you're using DBF files??!? QuoteOne set is used to just make connections to the database and tables and the other is used for created and updated records.Very strange. If one set is used just to make connection, what does it do? You're probably specifying the wrong field in your SQL!?!? Note that you can check what fields the db components sees in design mode: http://wiki.lazarus.freepascal.org/Database_metadata#Lazarus_TSQLQuery _metadata_tool and http://wiki.lazarus.freepascal.org/Working_With_TSQLQuery#Running_your _own_SQL_and_getting_metadata Can't say much more given your usual lack of detailed info (version numbers etc even) Hi BigChimp   While typing my post I have had eureka moment , it is because I have dbedit fields assigned to fields from the first SQL and the second SQL does not have all of these fields. Thanks TimCS