Topic: SQL query to poppulate a tablegrid

To make a search and to fill a tablegrid in the main form, I use an SQL query.
After searching, if I try to edit a record, I get an error (Unable to determine the record ID). What is my error?

Re: SQL query to poppulate a tablegrid

You have to add in your SQL query field id
Example: SELECT field1, field2, field3, id FROM table ...


also you can remove id column in table grid, let the name of this column delete_col
Example: Last Name, First Name, Surname, delete_col

Dmitry.

3 (edited by klompitone 2014-08-12 13:05:40)

Re: SQL query to poppulate a tablegrid

Thank you for your answer.
I added id in the query, like you suggest but I received an error: ambiguous column name: id.
I changed it to Scheda.id, but now when I try to edit a record after searching, I get an Access violation error (attached picture).
Any idea?
Also: thank you for the delete_col tip!

Post's attachments

Attachment icon error.jpg 13.39 kb, 471 downloads since 2014-08-12 

Re: SQL query to poppulate a tablegrid

Please, send me your project to support@drive-software.com

Dmitry.