Recent

Author Topic: [SOLVED] Any good examples with dbgrids out there  (Read 3141 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
[SOLVED] Any good examples with dbgrids out there
« on: September 04, 2011, 08:03:38 pm »
Hi all,

Let me put my questions another way. Are there any nice Lazarus examples with dbgrids with select,insert,edit functionality out there for e.g. Firebird, DB2, MySQL, PostgreSQL, MS SQL Server, MS Access, Oracle?

I'm still stuck on inserting from a grid (see earlier post), maybe there's an example I haven't seen..

thanks!

***edit: original question was solved. Still interested in nice sample applications, but not so urgent any more  :D
« Last Edit: September 05, 2011, 11:03:13 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

IPguy

  • Sr. Member
  • ****
  • Posts: 385
Re: [SOLVED] Any good examples with dbgrids out there
« Reply #1 on: January 05, 2012, 02:45:21 am »
I just ran across this example and bits of it worked for me.
http://pp4s.co.uk/main/tu-form-dbgrid-update-laz.html

Their "view" table did not work as well as mine.

Theirs:
Code: [Select]
procedure TfRCMMain.bGetTblClick(Sender: TObject);
begin
  SQLQuery1.Edit;
  SQLQuery1.Post;
  Sqlquery1.ApplyUpdates;
end;                   

Mine:
Code: [Select]
procedure TfRCMMain.GetTableGroupClick(Sender: TObject);
begin
  SQLQuery1.Close;
  SQLQuery1.SQL.Clear;
  SQLQuery1.SQL.Text := 'select * from Groups';
  SQLQuery1.Open
end;       
   

And while I liked their insert code which updated the DBGrid, it did not update the d/b.   Ditto with their delete line code.

The discovery continues ...



 

TinyPortal © 2005-2018