Solved

question for shane and a note

Posted on 2004-04-23
2
168 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now