Recent

Author Topic: dbnavigator  (Read 2187 times)

Hansvb

  • Sr. Member
  • ****
  • Posts: 347
dbnavigator
« on: September 11, 2015, 09:41:39 pm »
With the dbnavigator i want to delete the active record in a dbgrid.
The buttons first next prior and last work without any code behind it. to insert a record i had to add the next lines:

Code: [Select]
  case Button of
  nbPost   : begin
               SQLQuery1.UpdateMode:=UpWhereChanged;
               SQLQuery1.ApplyUpdates;
               DataModule_Oracle_Connection.OracleConnection1.Transaction.Commit;//  CommitRetaining
             end;


i hoped that the same code would work when i want to delete a record but then i get the warning:

SQLQUERY1: No delete query specified and failed to generate one.

Must i write a delete query?

LacaK

  • Hero Member
  • *****
  • Posts: 577
Re: dbnavigator
« Reply #1 on: September 13, 2015, 09:01:45 am »
SQLQUERY1: No delete query specified and failed to generate one.

Must i write a delete query?
Did you have written SQLQUERY1.UpdateSQL also ?
What is your SQLQUERY1.SQL.Text (is there single table in select or multiple tables joined) ?

Hansvb

  • Sr. Member
  • ****
  • Posts: 347
Re: dbnavigator
« Reply #2 on: September 13, 2015, 12:43:13 pm »
It is a single table with one column as a test.  Now i have made my own insert, delete, commit and rollback button. I skipped the dbnavigator.

LacaK

  • Hero Member
  • *****
  • Posts: 577
Re: dbnavigator
« Reply #3 on: September 14, 2015, 08:10:01 am »
probably SQLQuery can't determine key field. Is this one field declared also as primary key on table ?