Solved

question for shane and a note

Posted on 2004-04-23
2
170 Views
Last Modified: 2010-04-05

well i know you are busy and that you do really care that
i have just started delphi and i would like to use persons help who is more experienced and has worked on a lot of things

i belive in finishing stuff and that is not finished

well if you don't want to continuing with this to the finish line

that's up to you

sometimes you got to give people time when they doing stuff for the first time

anyway i really appreciate that you helped me i tried to learn stuff

which i belive i did and thank you
0
Comment
Question by:magma_george
2 Comments
 

Author Comment

by:magma_george
ID: 10904488
i am online
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 500 total points
ID: 10904914
unit UntDataMod;

interface

uses
  Forms, SysUtils, Classes, DB, ADODB;

type
  TfrmDataMod = class(TDataModule)
    dbMain: TADOConnection;
    tblPeople: TADOTable;
    tblAnimals: TADOTable;
    dsPeople: TDataSource;
    dsAnimals: TDataSource;
    procedure DataModuleCreate(Sender: TObject);
    procedure DataModuleDestroy(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmDataMod: TfrmDataMod;

implementation

{$R *.dfm}

procedure TfrmDataMod.DataModuleCreate(Sender: TObject);
begin
 dbMain.ConnectionString:= 'Provider=Microsoft.Jet.OLEDB.4.0;' +
                           'Data Source=' + ChangeFileExt(Application.ExeName,'.mdb')  + ';' +
                           'Persist Security Info=False';
 try
  dbMain.Connected:= true;
  tblPeople.Active:= True;
  tblAnimals.Active:= True;
 except
 end;
end;

procedure TfrmDataMod.DataModuleDestroy(Sender: TObject);
begin
 tblAnimals.Active:= False;
 tblPeople.Active:= False;
 dbMain.Connected:= False;
end;

end.

_____________________________________________________________________


unit UntMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Unit2, Unit3;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
 frmPeople.show;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  frmAnimals.show;
end;

end.

__________________________________________________

unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, Buttons;

type
  TfrmPeople = class(TForm)
    DBGrid1: TDBGrid;
    DBNavigator1: TDBNavigator;
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmPeople: TfrmPeople;

implementation

uses UntDataMod;

{$R *.dfm}

procedure TfrmPeople.FormActivate(Sender: TObject);
var I: Integer;
begin
with DBNavigator1 do
for I := 0 to ControlCount -1 do
 if Controls[I] is TNavButton then
  with TNavButton(Controls[I]) do
  begin
   Glyph := nil;
   Font.Style := [fsBold];
   Layout:= blGlyphTop;
   case TNavigateBtn(I) of
    nbInsert :begin
               Caption := 'Add';
               Glyph.LoadFromResourceName(HInstance, 'ADD');
              end;
    nbDelete : begin
                Caption := 'Delete';
                Glyph.LoadFromResourceName(HInstance, 'DELETE');
               end;

     nbPost   :begin
                Caption := 'Post';
                Glyph.LoadFromResourceName(HInstance, 'POST');
               end;
     nbCancel :begin
                Caption := 'Cancel';
                Glyph.LoadFromResourceName(HInstance, 'CANCEL');
               end;
     nbFirst :begin
               Caption := 'First';
               Glyph.LoadFromResourceName(HInstance, 'FIRST');
              end;
     nbLast :begin
               Caption := 'Last';
               Glyph.LoadFromResourceName(HInstance, 'LAST');
              end;
     nbNext :begin
               Caption := 'Next';
               Glyph.LoadFromResourceName(HInstance, 'NEXT');
              end;
     end;
  end;
end;

end.

_______________________________________________________________

unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, ExtCtrls, DBCtrls, Buttons;

type
  TfrmAnimals = class(TForm)
    DBNavigator1: TDBNavigator;
    DBGrid1: TDBGrid;
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmAnimals: TfrmAnimals;

implementation

uses UntDataMod;

{$R *.dfm}

procedure TfrmAnimals.FormActivate(Sender: TObject);
var I: Integer;
begin
with DBNavigator1 do
for I := 0 to ControlCount -1 do
 if Controls[I] is TNavButton then
  with TNavButton(Controls[I]) do
  begin
   Glyph := nil;
   Font.Style := [fsBold];
   Layout:= blGlyphTop;
   case TNavigateBtn(I) of
    nbInsert :begin
               Caption := 'Add';
               Glyph.LoadFromResourceName(HInstance, 'ADD');
              end;
    nbDelete : begin
                Caption := 'Delete';
                Glyph.LoadFromResourceName(HInstance, 'DELETE');
               end;

     nbPost   :begin
                Caption := 'Post';
                Glyph.LoadFromResourceName(HInstance, 'POST');
               end;
     nbCancel :begin
                Caption := 'Cancel';
                Glyph.LoadFromResourceName(HInstance, 'CANCEL');
               end;
     nbFirst :begin
               Caption := 'First';
               Glyph.LoadFromResourceName(HInstance, 'FIRST');
              end;
     nbLast :begin
               Caption := 'Last';
               Glyph.LoadFromResourceName(HInstance, 'LAST');
              end;
     nbNext :begin
               Caption := 'Next';
               Glyph.LoadFromResourceName(HInstance, 'NEXT');
              end;
     end;
  end;
end;

end.

0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question