📄 dmunit.cpp
字号:
// 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
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "DMUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "Oracle"
#pragma link "OracleData"
#pragma resource "*.dfm"
TDM *DM;
//---------------------------------------------------------------------------
__fastcall TDM::TDM(TComponent* Owner)
: TDataModule(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TDM::DataModule1Create(TObject *Sender)
{
// Show the logon dialog
OracleLogon->Execute();
// If not connected then exit
if (OracleSession->Connected)
{
try
{
// Test if the demotable exists
CheckTableQuery->Execute();
if (CheckTableQuery->Eof)
{
// If not, ask to create it
if (MessageDlg("Create demo table DOA_PICTUREDEMO ?", mtConfirmation,
TMsgDlgButtons() << mbYes << mbNo, 0) == mrYes)
CreateTableQuery->Execute();
else
OracleSession->Connected = false;
}
}
catch (EOracleError &E)
{
ShowMessage(E.Message);
}
}
// If everything is OK activate the dataset
if (OracleSession->Connected)
OracleDataSet->Active = true;
else
Application->Terminate();
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -