Board index » delphi » Beginner Help please!

Beginner Help please!

Hello! i am progamming a comic organizer for a school project, and whenever
i install this program on another computer i always get the error of 'index
is out of date' i've tried recreating the indexes for the database and it
still says this...

and i have another question.. say you have a date field, and the user enters
the date wrong and the program screws up.. is there anyway around this to
error trap this and have the program not quit?

thanks  - andrew

 

Re:Beginner Help please!


1. Have you set LOCAL SHARE to TRUE and NET DIR to the database directory in
the BDE Administrator ?

2. Try to check if the date is valid in the OnSetText event, e.g.:

procedure TForm1.Table1Field1SetText(Sender: TField; const Text: String);
begin
  try
    Sender.AsDateTime := StrToDateTime(Text);
  except
    MessageDlg('Invalid date !', mtError, [mbOk], 0);
    Sender.FocusControl;
    Abort;
  end;
end;

"andrew" <andre...@cableworks.org> schreef in bericht
news:6rv%5.108346$_5.23719912@news4.rdc1.on.home.com...

Quote
> Hello! i am progamming a comic organizer for a school project, and
whenever
> i install this program on another computer i always get the error of
'index
> is out of date' i've tried recreating the indexes for the database and it
> still says this...

> and i have another question.. say you have a date field, and the user
enters
> the date wrong and the program screws up.. is there anyway around this to
> error trap this and have the program not quit?

> thanks  - andrew

Re:Beginner Help please!


How would i do that for a DBEdit.Text box..
i've tried and it says like AsDateTime is an undeclared identifier

Quote
M.H. Avegaart <avegaartNOS...@mccomm.nl> wrote in message

news:91pm3t$cvk$1@porthos.nl.uu.net...
Quote
> 1. Have you set LOCAL SHARE to TRUE and NET DIR to the database directory
in
> the BDE Administrator ?

> 2. Try to check if the date is valid in the OnSetText event, e.g.:

> procedure TForm1.Table1Field1SetText(Sender: TField; const Text: String);
> begin
>   try
>     Sender.AsDateTime := StrToDateTime(Text);
>   except
>     MessageDlg('Invalid date !', mtError, [mbOk], 0);
>     Sender.FocusControl;
>     Abort;
>   end;
> end;

> "andrew" <andre...@cableworks.org> schreef in bericht
> news:6rv%5.108346$_5.23719912@news4.rdc1.on.home.com...
> > Hello! i am progamming a comic organizer for a school project, and
> whenever
> > i install this program on another computer i always get the error of
> 'index
> > is out of date' i've tried recreating the indexes for the database and
it
> > still says this...

> > and i have another question.. say you have a date field, and the user
> enters
> > the date wrong and the program screws up.. is there anyway around this
to
> > error trap this and have the program not quit?

> > thanks  - andrew

Re:Beginner Help please!


Quote
andrew <andre...@cableworks.org> wrote in message

news:Hm906.119306$_5.26812826@news4.rdc1.on.home.com...

Quote
> How would i do that for a DBEdit.Text box..
> i've tried and it says like AsDateTime is an undeclared identifier

Did you try just AsDate?

--
Smola
--
"And once again, the day is saved"
(http://supersmola.tripod.com/index.htm)

Other Threads