|
Add new Data
Module - App_DMod
Used to store Database, table, query and ... controls corresponding ...
List of Controls used in this
Form:
DataBase and
Table
|
Create Data Module ...
- On the File
menu , click New. and then click Data Module
New File name Unit1.pas appears. (Form name -
DataModule1)
- On the View menu ,
click Object Inspector. In
Object Inspector modify the following ...
1- Unit1.pas
|
Old |
New |
File Name: |
Unit1.pas |
App_DMod.pas |
|
2. DataModule1
|
Old |
New |
Form Name: |
DataModule1 |
AppDMod |
|
The
codes corresponding to the Data Module1 created by
system .... File name - Unit1.pas
.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes,
Graphics, Controls, Forms,
Dialogs;
type
TDataModule1 = class(TDataModule)
private
{ Private declarations }
public
{ Public declarations }
end;
var
DataModule1: TDataModule1;
implementation
{$R *.nfm}
end. |
Save this file
...
On the File menu ,
click Save
| |
1- |
App_DMod design |
|
 |
2- |
From the Tool palette add these
controls .. (From the View menu, click Tool
palette)
|
|
- Add the TDataBase control - Database1, Object
inspector:
connected: Database Name:
Login Prompt: Name: TransIsolation: |
True KJV2002A
False Database1 tiDirtyRead | |
KJV2002A:
Data Source Name (Datasource type ODBC)
- Add the TTable
control - Table1, Object
inspector:
Active: AutoRefresh:
DatabaseName: VName: |
True True KJV2002A Table1 | |
Bitmap file
added =
C:\App-VCSNet\Pic\butterfly1.bmp
- Add the TTable
control - Table2, Object
inspector
Active: AutoRefresh:
DatabaseName: VName: |
True True KJV2002A Table2 | |
Bitmap file
added =
C:\App-VCSNet\Pic\butterfly2.bmp
- Add the TTable
control - Table3, Object
inspector
Active: AutoRefresh:
DatabaseName: VName: |
True True KJV2002A Table3 | |
| | |
|
App-DMod, the
code
The text Code is Navy
color,
corresponding to code create by system |
|
unit App_DMod;
interface
uses
Windows, Messages, SysUtils, Variants, Classes,
Graphics, Controls, Forms,
Dialogs, System.ComponentModel, Borland.Vcl.Db,
Borland.Vcl.DBTables;
type
TAppDMod = class(TDataModule)
Database1: TDatabase;
Table1: TTable;
Table2: TTable;
Table3: TTable;
private
{ Private declarations }
public
{ Public declarations }
end;
var
AppDMod: TAppDMod;
implementation
{$R *.nfm}
end. | |
|
| | |
|
|