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

📄 odacdemoform.pas

📁 odac for oralce 8i,10g,11g easy to connect to oralce from delphi
💻 PAS
📖 第 1 页 / 共 2 页
字号:
  Demos.RegisterDemo('UpdateSQL', 'Using TOraUpdateSQL component', 'Demonstrates using the TOraUpdateSQL component to customize update commands.   Lets you optionally use TOraSQL and TOraQuery objects for carrying out insert, delete, query, and update commands.', 'Working with components', TUpdateSQLFrame, 12);
  Demos.RegisterDemo('VirtualTable', 'Using TVirtualTable component', 'Demonstrates working with the TVirtualTable component. This sample shows how to fill virtual dataset with data from other datasets, filter data by a given criteria, locate specified records, perform file operations, and change data and table structure.', 'Working with components', TVirtualTableFrame, 13, 'VTable');

  Demos.RegisterDemo('CachedUpdates', 'Cached updates, transaction control', 'Demonstrates how to perform the most important tasks of working with data in CachedUpdates mode, ' + ' including highlighting uncommitted changes, managing transactions, and committing changes in a batch.', 'General demos', TCachedUpdatesFrame, 1);
  Demos.RegisterDemo('FilterAndIndex', 'Using Filter and IndexFieldNames', 'Demonstrates ODAC''s local storage functionality.  This sample shows how to perform local filtering, sorting and locating by multiple fields, including by calculated and lookup fields.', 'General demos', TFilterAndIndexFrame, 1);
  Demos.RegisterDemo('MasterDetail', 'Master/detail relationship', 'Uses ODAC functionality to work with master/detail relationships. This sample shows how to use local master/detail functionality. Demonstrates different kinds of master/detail linking, inluding linking by SQL, by simple fields, and by calculated fields.', 'General demos', TMasterDetailFrame, 1);
  Demos.RegisterDemo('Pictures', 'Working with BLOB field', 'Uses ODAC functionality to work with graphics. The sample demonstrates how to retrieve binary data from Oracle database and display it on visual components.  Sample also shows how to load and save pictures to files and to the database.', 'General demos', TPicturesFrame, 1);
{$IFDEF WIN32}
  Demos.RegisterDemo('Threads', 'Using ODAC in multi-threaded environment', 'Demonstrates how ODAC can be used in multithreaded applications. This sample allows you to set up several threads and test ODAC''s performance with multithreading.', 'General demos', TThreadsFrame, 1);
{$ENDIF}
  Demos.RegisterDemo('Arrays', 'Working with VARRAY type', 'Demonstrates working with Oracle arrays. This sample lets you view and control how arrays are represented in dataset fields by the SparseArrays and ObjectView properties.', 'Oracle specific', TArraysFrame, 1);
  Demos.RegisterDemo('BFile', 'Working with BFile type', 'Shows the basics of working with file binary data stored in file systems located outside Oracle databases. This sample  uses the TBFileField field type of ODAC.', 'Oracle specific', TBFileFrame, 1);
  Demos.RegisterDemo('BlobPictures', 'Working with Oracle8 BLOB type', 'Demonstrates working with Oracle BLOB data types. The sample shows how to get binary data from the table, how to change BLOB fields using UPDATE statements, ' + 'and how to insert a new record by executing stored procedure with a BLOB parameter. Also it shows off some extended BLOB handling functionality like local caching control, compression type changing, and more.', 'Oracle specific', TBlobPicturesFrame, 1);
  Demos.RegisterDemo('Clob', 'Working with CLOB fields', 'emonstrates working with Oracle CLOB data types. The sample shows how to get a character stream from a table, how to change CLOB fields using UPDATE statements, and how to' + ' save and load data to/from a file.  It also demonstrates some different ways you can perform CLOB insertion.', 'Oracle specific', TClobFrame, 1);
  Demos.RegisterDemo('Cursor', 'Using PL/SQL ref cursor', 'Uses ODAC functionality to work with Oracle Cursors. Shows how to fetch data from a Cursor parameter by setting OraQuery.Cursor to the TOraParam.AsCursor.', 'Oracle specific', TCursorFrame, 1);
  Demos.RegisterDemo('DMLArray', 'Working with DML array operations', 'Demonstrates how to  multiply execute SQL statements with different parameters by using ODAC functionality for the Oracle DML array feature.', 'Oracle specific', TDMLArrayFrame, 1);
  Demos.RegisterDemo('FetchCursors', 'Fetching cursors of Oracle8 by ODAC', 'Uses TOraQuery to retrieve several Oracle cursors at once, fetch data in a batch, and close the cursors.', 'Oracle specific', TFetchCursorsFrame, 1);
  Demos.RegisterDemo('Long', 'Working with LONG fields', 'Demonstrates working with Oracle LONG data types. The sample shows how to get character string from a table, update LONG fields and insert a new record. Also shows how to perform file operations with LONG fields.', 'Oracle specific', TLongFrame, 1);
  Demos.RegisterDemo('LongStrings', 'Working with string fields', 'Demonstrates ODAC functionality for working with long string fields ( fields that have more than 256 characters).  Shows the different ways they can be displayed as memo fields and string fields.', 'Oracle specific', TLongStringsFrame, 1);
  Demos.RegisterDemo('MultiCursors', 'Working with multiple cursors', 'Shows how to use one OraQuery object to retrieve and update data from several tables by using several REF CURSOR parameters.', 'Oracle specific', TMultiCursorsFrame, 1);
  Demos.RegisterDemo('MultiQueries', 'Non blocking opening query', 'Shows how Oracle queries are handled in multithreaded applications.  This sample project lets you compare opening multiple queries within a single session or different sessions by setting NonBlocking and FetchAll=False modes.', 'Oracle specific', TMultiQueriesFrame, 1);
{$IFNDEF STD}
  Demos.RegisterDemo('NestedTables', 'Using Oracle8 table type', 'Demonstrates using the TOraNestedTable component to work with Oracle nested tables. This sample project fills a TOraNestedTable dataset instance with the result set of a query to a table with a nested table field. It shows how to work with the ' + 'data contained in nested table fields.  Note that the nested table accessing interface is similar as the interface for accessing cursor data in a dataset representation of a table with CURSOR fields.', 'Oracle specific', TNestedTablesFrame, 1);
{$ENDIF}
  Demos.RegisterDemo('Objects', 'Using Oracle8 object type', 'Demonstrates working with Oracle object fields.  This sample shows how to clone objects and access and modify object field properties.', 'Oracle specific', TObjectsFrame, 1);
{$IFNDEF LINUX}
{$IFNDEF STD}
  Demos.RegisterDemo('Pipes', 'Using TOraLoader component with pipes', 'Uses TOraAlerter in Pipe mode to organize cross-session message exchanging.', 'Oracle specific', TPipesFrame, 1);
{$ENDIF}
{$ENDIF}
  Demos.RegisterDemo('PLSQLTable', 'Working with PL/SQL tables', 'Demonstrates using PL/SQL Table types as parameters.  Working with PL/SQL Table types in PL/SQL lets you imitate array ' + 'functionality provided by other programming languages.', 'Oracle specific', TPLSQLTableFrame, 1);
{$IFNDEF LINUX}
{$IFNDEF STD}
  Demos.RegisterDemo('Progressor', 'Using TOraAlerter for longtime Oracle process', 'Uses TOraAlerter in Pipe mode to indicate the progress of long-duration Oracle processes.', 'Oracle specific', TProgressorFrame, 1);
{$ENDIF}
{$ENDIF}
  Demos.RegisterDemo('ProxySession', 'Connecting to Oracle using proxy session', 'Demonstrates connecting to Oracle with the Oracle Proxy session functionality. This type of connection allows to quickly establish connections without specifying a password.  Note: Requires the CONNECT THROUGH privilege.', 'Oracle specific', TProxySessionFrame, 1);
{$IFNDEF STD}
  Demos.RegisterDemo('Refs', 'Using Oracle8 REF types', 'Demonstrates using the REF Oracle data type in queries.', 'Oracle specific', TRefsFrame, 1);
{$ENDIF}
{$IFNDEF LINUX}
{$IFNDEF STD}
  Demos.RegisterDemo('SmartRefresh', 'Using TSmartQuery', 'Uses the Smart Refresh features of TSmartQuery to notify other subscribed users about your data changes.  This sample is based on the TOraAlerter component.  Note: Smart Refresh is only available in ODAC Professional Edition and ODAC Developer Edition.', 'Oracle specific', TSmartRefreshFrame, 1);
{$ENDIF}
{$ENDIF}
  Demos.RegisterDemo('XMLType', 'Using TOraXMLField component', 'Uses the TOraXMLField class to work with Oracle SYS.XMLTYPE type LOB or Schema-based data. This sample project shows how to perform all the basic operations with this data type.', 'Oracle specific', TXMLTypeFrame, 1);

// Registering Supplementary Demo Projects

  Demos.RegisterCategory('Miscellaneous', '', -1, True);
{$IFDEF CLR}
  Demos.RegisterDemo('AspNet', 'AspNet hint', 'Uses OraDataAdapter to create a simple ASP .NET application.  This application creates an ASP.NET application that lets you connect to a database and execute queries.' + '  Shows how to display query results in a DataGrid and send user changes back to the database.', 'Miscellaneous', nil, 1, '', True);
{$ENDIF}
{$IFNDEF CLR}
  Demos.RegisterDemo('Dll', 'Dll hint', 'Demonstrates creating and loading DLLs for ODAC-based projects. This demo project consists of two parts - an OraDll project that creates a DLL of a form that sends a query to the server and displays ' + 'its results, and an OraExe project that can be executed to display a form for loading and running this DLL.  Allows you to build a dll for one ODAC-based project and load and test it from a separate application.', 'Miscellaneous', nil, 1, '', True);
  Demos.RegisterDemo('ExternalProc', 'Dll hint', 'Uses external procedures to save LOB data to file on an Oracle server and store the file name and file date in a database. This demo project uses the external procedure DLL file described ' + 'in the Writing Oracle external procedures with ODAC topic.', 'Miscellaneous', nil, 1, '', True);
{$ENDIF}
  Demos.RegisterDemo('FailOver', 'FailOver hint', 'Demonstrates the recommended approach to working with unstable networks. This sample lets you perform transactions and updates in several different modes, simulate a sudden session termination, ' + 'and view what happens to your data state when connections to the server are unexpectedly lost.  Shows off CachedUpdates, LocalMasterDetail, FetchAll, Pooling, and different Failover modes.', 'Miscellaneous', nil, 1, '', True);
{$IFNDEF CLR}
  Demos.RegisterDemo('Midas', 'Midas hint', 'Demonstrates using MIDAS technology with ODAC.  This project consists of two parts: a MIDAS server that processes requests to the database and a thin MIDAS client that displays an interactive grid.  ' + 'This demo shows how to build thin clients that display interactive components and delegate all database interaction to a server application for processing. ', 'Miscellaneous', nil, 1, '', True);
  Demos.RegisterDemo('Performance', 'Performance', 'Measures ODAC performance on several types of queries.  This project lets you compare ODAC performance to BDE, ADO, and dbExpress. Tests the following functionality: ' + 'Fetch, Master/Detail, Stored Procedure Call, Data Loading,  Multi Executing, and Insert/Post.', 'Miscellaneous', nil, 1, '', True);
{$ENDIF}
{$IFDEF CLR}
  Demos.RegisterDemo('WinForms', 'AspNet hint', 'Shows how to use ODAC to create a  WinForm application.  This demo project creates a simple WinForms application and fills a data grid from an OraDataAdapter data source.', 'Miscellaneous', nil, 1, '', True);
{$ENDIF}
{$IFNDEF CLR}
  Demos.RegisterCategory('', '', -1, True);
{$ENDIF}

{$IFNDEF CLR}
  Demos.RegisterCategory('ThirdParty', '', -1, True);
  Demos.RegisterDemo('FastReport', 'FastReport hint', 'Demonstrates how ODAC can be used with FastReport components. This project consists of two parts.  The first part is several packages that integrate ODAC components into the FastReport editor.' + ' The second part is a demo application that lets you design and preview reports with ODAC technology in the FastReport editor.', 'ThirdParty', nil, 1, '', True);
  Demos.RegisterDemo('InfoPower', 'InfoPower hint', 'Uses InfoPower components to display recordsets retrieved with ODAC.  This demo project displays an InfoPower grid component and fills it with the result of an ODAC query.' + '  Shows how to link ODAC data sources to InfoPower components.', 'ThirdParty', nil, 1, '', True);
  Demos.RegisterDemo('IntraWeb', 'IntraWeb hint', 'A collection of sample projects that show how to use ODAC components as data sources for IntraWeb  applications.  Contains IntraWeb samples for setting up a connection, querying ' + 'a database and modifying data and working with CachedUpdates and MasterDetail relationships.  Starting with Oracle 10.2g and higher lets you see the effect of setting TOraCachedUpdates.', 'ThirdParty', nil, 1, '', True);
  Demos.RegisterDemo('QuickReport', 'QuickReport hint', 'Lets you launch and view a QuickReport application based on ODAC.  This demo project lets you modify the application in design-time.', 'ThirdParty', nil, 1, '', True);
  Demos.RegisterDemo('ReportBuilder', 'ReportBuilder hint', 'Uses ODAC data sources to create a ReportBuilder report that takes data from an Oracle database. This demo project shows how to set up a ReportBuilder document in design-time and how to integrate ' + 'ODAC components into the Report Builder editor to perform document design in run-time.', 'ThirdParty', nil, 1, '', True);
{$IFNDEF CLR}
  Demos.RegisterCategory('', '', -1, True);
{$ENDIF}
{$ENDIF}

end;

procedure TOdacForm.InitializeDemoFrame(Frame: TDemoFrame; DemoType: TDemoType);
begin
  inherited;
  if Frame is TOdacDemoFrame then
    TOdacDemoFrame(Frame).SetDirect(cbDirect.Checked);
end;

procedure TOdacForm.cbDirectClick(Sender: TObject);
begin
  OraSession.Options.Direct := cbDirect.Checked;
  if Demos.SelectedDemo.Frame is TOdacDemoFrame then
    TOdacDemoFrame(Demos.SelectedDemo.Frame).SetDirect(cbDirect.Checked);
end;

procedure TOdacForm.lbAboutClick(Sender: TObject);
begin
  inherited;

  with TOdacAboutForm.Create(nil) do begin
    ShowModal;
    Free;
  end;
end;

procedure TOdacForm.FormCreate(Sender: TObject);
begin
  inherited;

  cbDirect.Enabled := GetPropInfo(OraSession.Options, 'Direct') <> nil;
end;

procedure TOdacForm.FormResize(Sender: TObject);
begin
  inherited;

  cbDirect.Left := cbDebug.Left - (cbDirect.Width + 10);
  pnOpenDemoDir.Left := cbDirect.Left - (pnOpenDemoDir.Width + 15);
  pnShowSource.Left := pnOpenDemoDir.Left - (pnShowSource.Width + 15);
end;

procedure TOdacForm.ExecCreateScript;
begin
  if VersionStrToWord(OraSession.OracleVersion) >= 8000 then
    scCreate.MacroByName('Len').AsInteger := 4000
  else
    scCreate.MacroByName('Len').AsInteger := 2000;
  scCreate.Execute;
  if VersionStrToWord(OraSession.OracleVersion) >= 8000 then
    scCreateOracle8.Execute;
  if VersionStrToWord(OraSession.OracleVersion) >= 9000 then
    scCreateOracle9.Execute;
end;

procedure TOdacForm.ExecDropScript;
begin
  if VersionStrToWord(OraSession.OracleVersion) >= 9000 then
    scDropOracle9.Execute;
  if VersionStrToWord(OraSession.OracleVersion) >= 8000 then
    scDropOracle8.Execute;
  scDrop.Execute;
end;

procedure TOdacForm.cbDebugClick(Sender: TObject);
begin
  inherited;
  scCreate.Debug := cbDebug.Checked;
  scDrop.Debug := cbDebug.Checked;
  scCreateOracle8.Debug := cbDebug.Checked;
  scDropOracle8.Debug := cbDebug.Checked;
  scCreateOracle9.Debug := cbDebug.Checked;
  scDropOracle9.Debug := cbDebug.Checked;
end;

end.

⌨️ 快捷键说明

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