将delphi连接到oracle并检索数据

时间:2014-10-14 02:05:40

标签: sql oracle delphi

我是德尔福的初学者。我已按照here中的教程进行操作。这是我的第一课。我想用delphi 7从oracle中检索数据。我的脚本是这样的:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Grids, DBGrids, DB, ADODB;

type
  TForm_Test = class(TForm)
    ADOConnection_main: TADOConnection;
    qryTable_test: TADODataSet;
    dsTable_test: TDataSource;
    dbgTable_test: TDBGrid;
    btnUpload: TButton;
    procedure btnUploadClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form_Test: TForm_Test;

implementation

{$R *.dfm}

procedure TForm_Test.btnUploadClick(Sender: TObject);
begin
  Form_Test.qryTable_test.SQL.Clear;
  Form_Test.qryTable_test.SQL.Add('Select * from table');
  Form_Test.qryTable_test.Active:=true;
end;


end.

获取错误:

[Error] Unit1.pas[34]: Undeclared identifier: 'SQL'

中的

Form_Test.qryTable_test.sql.clear;

我该怎么办?

0 个答案:

没有答案