Recent

Author Topic: Oracle and DBGrid  (Read 4797 times)

blindkangaroo

  • Newbie
  • Posts: 1
Oracle and DBGrid
« on: July 06, 2007, 08:56:02 pm »
I'm a Lazarus newbie and database newbie really and I'm trying to run an SQL query on an Oracle database but I can't get the results to display in a DBGrid.

I have the DataSource DataSet as SQLQuery1 and the datasource for the DBGrid as DataSource1. Here is the code to run the query.

Code: [Select]

procedure Tfrm_imsman_main.btn_searchClick(Sender: TObject);
begin
  OpenConnection(nil);
  SQLQuery1.Close;
  SQLQuery1.SQL.Clear;
  SQLQuery1.SQL.Text := 'select * from gve_products';
  ShowString(SqlQuery1.SQL.Text);
  SQLQuery1.Open;
  SQLQuery1.Close;
end;



Thanks for any and all help
Cheers,
B

nelson777

  • Jr. Member
  • **
  • Posts: 68
    • http://www.aocontrario.com
RE: Oracle and DBGrid
« Reply #1 on: July 06, 2007, 10:21:52 pm »
I think the better advice I can give u is to check the lazarus database tutorials in the documentation Wiki.  I tried the link to give u the exact address but the wiki is offline (I wonder why ?). So I guess u have to wait a bit.

 

TinyPortal © 2005-2018