⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainunit.pas

📁 Direct Oracle Access 非常好的Oracle数据库直接访问组件包 支持个版本的Delphi及C++ Builder 有源码
💻 PAS
字号:
// Direct Oracle Access - PictureDemo
// Allround Automations
// support@allroundautomations.nl
// http://www.allroundautomations.nl
//
// This application demonstrates:
// - The use of a BLOB field in a dataset
// - The use of Data Definition Language (creating & dropping a table)
// - The use of a Data Module for the DOA components

unit MainUnit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  JPeg, StdCtrls, DBCtrls, Mask, ExtDlgs, Buttons, Grids, DBGrids, Db,
  OracleData, Oracle, ExtCtrls, DMUnit;

type
  TMainForm = class(TForm)
    GridPanel: TPanel;
    NavigatorPanel: TPanel;
    PicPanel: TPanel;
    DataPanel: TPanel;
    DBGrid: TDBGrid;
    DBNavigator: TDBNavigator;
    LoadButton: TSpeedButton;
    DBImage: TDBImage;
    NameGroupBox: TGroupBox;
    InfoGroupBox: TGroupBox;
    InfoDBMemo: TDBMemo;
    NameDBEdit: TDBEdit;
    OpenPictureDialog: TOpenPictureDialog;
    DeletePanel: TPanel;
    DropButton: TSpeedButton;
    procedure LoadButtonClick(Sender: TObject);
    procedure DropButtonClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainForm: TMainForm;

implementation

{$R *.DFM}

procedure TMainForm.LoadButtonClick(Sender: TObject);
begin
  // Open the load picture dialog
  if OpenPictureDialog.Execute then
  begin
    // Switch to edit mode before loading the picture
    if DM.OracleDataSet.State = dsBrowse then DM.OracleDataSet.Edit;
    DM.Picture.LoadFromFile(OpenPictureDialog.FileName);
    // Set the Filename field
    DM.Filename.Value := OpenPictureDialog.Filename;
  end;
end;

procedure TMainForm.DropButtonClick(Sender: TObject);
begin
  // Should the demo table be dropped?
  if Application.MessageBox('Drop the demo table DOA_PICTUREDEMO ?', 'Confirm',
       mb_YESNO + mb_IconQuestion) = IDYES then
  begin
    // First deactivate the dataset
    DM.OracleDataSet.Active := False;
    // Then drop the table
    DM.DropTableQuery.Execute;
    // There is nothing left to do, so we terminate the program
    Application.Terminate;
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -