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

📄 odacdemoform.pas

📁 odac for oralce 8i,10g,11g easy to connect to oralce from delphi
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{$I DacDemo.inc}

unit OdacDemoForm;

interface

uses
{$IFDEF LINUX}
  SysUtils, Types, Classes, QGraphics, QControls, QForms, QMenus, QImgList,
  QStdCtrls, QComCtrls, QButtons, QExtCtrls, QTypes, OdacClx,
{$ELSE}
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Menus, ImgList, StdCtrls, ComCtrls, Buttons, ExtCtrls, ToolWin, OdacVcl,
{$ENDIF}
  DB,
  {$IFNDEF VER130}Variants,{$ENDIF}
  DBAccess,
  Ora,
  OraCall,
  DAScript, 
  OraScript,
  OdacAbout,
  DemoFrame,
  DemoBase,
  DemoForm,
  OdacDemoFrame
  ;

type
  TOdacForm = class(TDemoForm)
    cbDirect: TCheckBox;
    OraSession: TOraSession;
    ConnectDialog: TConnectDialog;
    scCreate: TOraScript;
    scDrop: TOraScript;
    scCreateOracle8: TOraScript;
    scDropOracle8: TOraScript;
    scCreateOracle9: TOraScript;
    scDropOracle9: TOraScript;
    procedure cbDirectClick(Sender: TObject);
    procedure lbAboutClick(Sender: TObject); override;
    procedure FormCreate(Sender: TObject); override;
    procedure FormResize(Sender: TObject);
    procedure cbDebugClick(Sender: TObject);
  protected
    //Product customization
    function GetConnection: TCustomDAConnection; override;
    function ApplicationTitle: string; override;
    function ProductName: string; override;
    procedure RegisterDemos; override;
    //Demo selection
    procedure InitializeDemoFrame(Frame: TDemoFrame; DemoType: TDemoType); override;
  public
    function ProductColor: TColor; override;
    procedure ExecCreateScript; override;
    procedure ExecDropScript; override;
  end;

var
  OdacForm: TOdacForm;

implementation

uses
  TypInfo, ConnectDialog, Query, Smart, Sql, StoredProc, Table,
  UpdateSQL, VTable, CachedUpdates, FilterAndIndex, MasterDetail,
  Pictures, Arrays, BFile, BlobPictures, Clob, Cursor, DMLArray, FetchCursors,
  Long, LongStrings, MultiCursors, MultiQueries, Objects,
  PLSQLTable, ProxySession,
{$IFDEF WIN32}
  Threads,
{$ENDIF}
{$IFNDEF LINUX}
{$IFDEF CRDBGRID}
  CRDBGrid,
{$ENDIF}
{$ENDIF}

{$IFNDEF STD}
  ErrorHandler, NestedTables, Loader, Queue, Refs, Trace, Transaction,
{$IFDEF WIN32}
  BDESess,
{$ENDIF}
{$IFNDEF LINUX}
  Alerter, ChangeNotification, Pipes, Progressor, SmartRefresh,
{$ENDIF}
{$ENDIF}
  XMLType;

{$IFDEF CLR}
{$R *.nfm}
{$ENDIF}
{$IFDEF WIN32}
{$R *.dfm}
{$ENDIF}
{$IFDEF LINUX}
{$R *.xfm}
{$ENDIF}

function TOdacForm.GetConnection: TCustomDAConnection;
begin
  Result := OraSession;
end;

function TOdacForm.ProductColor: TColor;
begin
  Result := TColor($000000AA);
end;

function TOdacForm.ApplicationTitle: string;
begin
  Result := 'Oracle Data Access Components demos';
end;

function TOdacForm.ProductName: string;
begin
  Result := 'ODAC';
end;

procedure TOdacForm.RegisterDemos;
begin
  Demos.RegisterCategory('ODAC Demo', 'ODAC Demo');
  Demos.RegisterCategory('Working with components', 'Working with components');
  Demos.RegisterCategory('General demos', 'General demos');
  Demos.RegisterCategory('Oracle specific', 'Oracle specific');
{$IFNDEF STD}
{$IFNDEF LINUX}
  Demos.RegisterDemo('Alerter', 'Using TOraAlerter component', 'Uses the TOraAlerter component to send messages between sessions through DBMS_ALERT and DBMS_PIPE Oracle package functionality. Requires execute privileges on DBMS_ALERT.', 'Working with components', TAlerterFrame, 2);
{$ENDIF}
{$IFDEF WIN32}
  Demos.RegisterDemo('BDESession', 'Using TBDESession component', 'Demonstrates how to integrate ODAC with an existing BDE connection using the TBDESession ODAC component.', 'Working with components', TBDESessionFrame, 3, 'BDESess');
{$ENDIF}
{$IFNDEF LINUX}
  Demos.RegisterDemo('ChangeNotification', 'Using TOraChangeNotification component', 'Demonstrates how to subscribe, receive, and reflect DML or DDL changes on objects associated with queries. Requires CHANGE NOTIFICATION privilege.  This functionallity is available only for Oracle 10.2g or higher.', 'Working with components', TChangeNotificationFrame, 17);
{$ENDIF}
{$ENDIF}
  Demos.RegisterDemo('ConnectDialog', 'Customizing login dialog', 'Demonstrates how to customize the ODAC connect dialog. Changes the standard ODAC connect dialog to two custom connect dialogs.  ' + ' The first customized sample dialog is inherited from the TForm class, and the second one is inherited from the default ODAC connect dialog class.', 'Working with components', TConnectDialogFrame, 4);
{$IFNDEF LINUX}
{$IFDEF CRDBGRID}
  Demos.RegisterDemo('CRDBGrid', 'Using TCRDBGrid component', 'Demonstrates how to work with the TCRDBGrid component.  Shows off the main TCRDBGrid features, like filtering, searching, stretching, using compound headers, and more.', 'Working with components', TCRDBGridFrame, 5);
{$ENDIF}
{$ENDIF}
{$IFNDEF STD}
  Demos.RegisterDemo('ErrorHandler', 'Using TOraErrorHandler component', 'Demonstrates using the TOraErrorHandler component to translate error messages.', 'Working with components', TErrorHandlerFrame, 18);
  Demos.RegisterDemo('Loader', 'Using TOraLoader component', 'Uses the TOraLoader component to quickly load data into a server table.  Demonstrates Direct and DML modes for loading data.  In Direct mode, data is loaded through DirectPath API, which load big volumes data into ' + 'a table faster than using INSERT statement. In DML mode, data is processed with the DML array feature of Oracle. Also compares the two TOraLoader data loading handlers: GetColumnData and PutData.', 'Working with components', TLoaderFrame, 6);
{$ENDIF}
  Demos.RegisterDemo('Query', 'Using TOraQuery component', 'Demonstrates working with TOraQuery, which is one of the most useful ODAC components. Includes many TOraQuery usage scenarios. Demonstrates how to execute queries in both standard and NonBlocking mode and how to edit data and export it to XML files. ' + 'Note: This is a very good introductory demo. We recommend starting here when first becoming familiar with ODAC', 'Working with components', TQueryFrame, 7);
{$IFNDEF STD}
  Demos.RegisterDemo('Queue', 'Demonstrates how to use ODAC to work with Oracle Streams Advanced Queuing.  Implements notification on new messages.  Shows how to create and manage Oracle Queues.  ' + ' Demonstrates the TOraQueue, TOraQueueTable, and TOraQueueAdmin components.Note: Requires DBMS_AQ and DBMS_AQADM privileges.', 'This sample project demonstrates using TOraQueue, TOraQueueTable and TOraQueueAdmin components. ' + 'Demo demonstrates queue table creating, altering and dropping, queue creating, dropping, altering, starting and stopping, enqueuing and dequeuing messages with different payload types', 'Working with components', TQueueFrame, 16);
{$ENDIF}
  Demos.RegisterDemo('Smart', 'Using TSmartQuery component', 'Uses TSmartQuery to customize refreshing, sorting, and server-side record management in a data grid. Shows how to perform local filtering, demonstrates several different kinds of record locking and refreshing, and working with FetchAll mode.', 'Working with components', TSmartFrame, 8);
  Demos.RegisterDemo('Sql', 'Using TOraSQL component', 'Uses TOraSQL to execute SQL statements and PL/SQL blocks.  Demonstrates how to work in standard and NonBlocking modes, how to work with parameters in SQL, and how to break long-duration query execution.', 'Working with components', TSqlFrame, 9);
  Demos.RegisterDemo('StoredProc', 'Using TOraStoredProc component', 'Uses TOraStoredProc to access an editable recordset represented by an Oracle cursor from an Oracle stored procedure in the client application.', 'Working with components', TStoredProcFrame, 10);
  Demos.RegisterDemo('Table', 'Using TOraTable component', 'Demonstrates how to use TOraTable to work with data from a single table on the server without manually writing any SQL queries. ' + 'Performs server-side data sorting and filtering and retrieves results for browsing and editing.', 'Working with components', TTableFrame, 11);
{$IFNDEF STD}
  Demos.RegisterDemo('Trace', 'Using TOraTrace component', 'This sample project demonstrates using TOraTrace component', 'Working with components', TTraceFrame, 15);
  Demos.RegisterDemo('Transaction', 'Using TOraTransaction component', 'Demonstrates the main approaches for setting up distributed transactions with the TOraTransaction component.  ' + 'Shows how to manage transactions, tune the transaction isolation level, and select the coordinator for a distributed transaction.', 'Working with components', TTransactionFrame, 14);
{$ENDIF}

⌨️ 快捷键说明

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