Board index » delphi » "Creating forms" revisited

"Creating forms" revisited

    I wrote too soon, saying that the program worked now. I start with all
my tables "active" set to false. But when I try to open the first one at
run-time my program locks up. If I change the order in which I open them, it
still locks up on the first one. As before, it worked a few times and then
started acting like this.
    I'd appreciate any ideas or similar experiences.
    Thanks -- Lloyd Edwards
 

Re:"Creating forms" revisited


Do you have your tables in a DataModule? If so, is the DataModule created
before the mainform?
What type of database do you use?

Alfred.

"Lloyd Edwards" <Llo...@sc.rr.com> schreef in bericht
news:7E2W8.8859$At1.626721@twister.southeast.rr.com...

Quote
>     I wrote too soon, saying that the program worked now. I start with all
> my tables "active" set to false. But when I try to open the first one at
> run-time my program locks up. If I change the order in which I open them,
it
> still locks up on the first one. As before, it worked a few times and then
> started acting like this.
>     I'd appreciate any ideas or similar experiences.
>     Thanks -- Lloyd Edwards

Re:"Creating forms" revisited


    I'm not using a DataModule, and my tables are the standard Paradox 7
formats. One table is a source table for the others; at the beginning of the
program, a target table is filled with information from the source table,
and then three fields in the target table serve as master fields for three
other tables, each of which displays a memo field keyed on the target key.
    Hope this is clear enough. Still a mystery to me.
    On second thought, let me be more specific. I'm trying to calculate the
liturgical calendar for the Episcopal Church. The source table has all the
major days, the Sundays, etc. The program uses those to fill a table called
TempYear, which has a record for each day of the year. Each record contiains
the name of the day as well as the color, a key for the collect for the day,
a key for the Eucharistic Lectionary, and a key for the Daily Office
Lectionary. Three other tables: one has a key and the text for the collect,
the next has a key and the text for Daily Office Lectionary, and the third a
key and the text fo rthe Eucharistic Lectionary. Then I have three DBMemos
on the form, one for each of the three, keyed on TempYear.
    Is there a limit on the number of memos, the number of tables, etc.? I
haven't seen such in any of the documentation.
    I also once got a DBError that said the the BLOB had been changed. I've
not been able to find any documentation for that error, but I think the memo
fields are "really" BLOB fields.
    Any help is greatly appreciated.
    Lloyd Edwards

"Alfred ten Hoeve" <Alfred.NoS...@SimpelProg.nl> wrote in message
news:3d28ba28$0$222$4d4ebb8e@news.nl.uu.net...

Quote
> Do you have your tables in a DataModule? If so, is the DataModule created
> before the mainform?
> What type of database do you use?

> Alfred.

> "Lloyd Edwards" <Llo...@sc.rr.com> schreef in bericht
> news:7E2W8.8859$At1.626721@twister.southeast.rr.com...
> >     I wrote too soon, saying that the program worked now. I start with
all
> > my tables "active" set to false. But when I try to open the first one at
> > run-time my program locks up. If I change the order in which I open
them,
> it
> > still locks up on the first one. As before, it worked a few times and
then
> > started acting like this.
> >     I'd appreciate any ideas or similar experiences.
> >     Thanks -- Lloyd Edwards

Re:"Creating forms" revisited


By accident I pushed the wrong button earlier this evening and sended this
one to your personel address. Sorry for that.
Alfred.

Lloyd,

see my lines between yours.

Further this:
I suppose you open the tables in the OnCreate event in your mainform.
Can you show the code for that eventhandler and can you trace the line where
your app goes nuts?

Hope this helps you a bit further,
Alfred.

Quote
----- Original Message -----
From: "Lloyd Edwards" <Llo...@sc.rr.com>

Newsgroups: alt.comp.lang.borland-delphi
Sent: Monday, July 08, 2002 1:09 AM
Subject: Re: "Creating forms" revisited

>     I'm not using a DataModule, and my tables are the standard Paradox 7
> formats. One table is a source table for the others; at the beginning of
the
> program, a target table is filled with information from the source table,

Is the target table a temporary table, a ClientDataset or an InMemory table?
Is it filled with data before you open the detail tables?

> and then three fields in the target table serve as master fields for three
> other tables, each of which displays a memo field keyed on the target key.
>     Hope this is clear enough. Still a mystery to me.
>     On second thought, let me be more specific. I'm trying to calculate
the
> liturgical calendar for the Episcopal Church. The source table has all the
> major days, the Sundays, etc. The program uses those to fill a table
called
> TempYear, which has a record for each day of the year. Each record
contiains
> the name of the day as well as the color, a key for the collect for the
day,
> a key for the Eucharistic Lectionary, and a key for the Daily Office
> Lectionary. Three other tables: one has a key and the text for the
collect,
> the next has a key and the text for Daily Office Lectionary, and the third
a
> key and the text fo rthe Eucharistic Lectionary. Then I have three DBMemos
> on the form, one for each of the three, keyed on TempYear.
>     Is there a limit on the number of memos, the number of tables, etc.? I
> haven't seen such in any of the documentation.

No, only the amount of RAM is essential.

>     I also once got a DBError that said the the BLOB had been changed.
I've
> not been able to find any documentation for that error, but I think the
memo
> fields are "really" BLOB fields.

They are.

>     Any help is greatly appreciated.
>     Lloyd Edwards

Re:"Creating forms" revisited


Dear Alfred,
    Here is the FormActivate code:

procedure TfrmMain2.FormActivate(Sender: TObject);
var I : integer;
    Yr, Mo, Da : word;
begin
  for I := 2000 to 2050 do    // populate ComboBox1 with years
  ComboBox1.Items.Add(IntToStr(I));

  DecodeDate(Now, Yr, Mo,Da);
  TabControl1.Tabs[0] := IntToStr(Yr);

  ComboBox1.ItemIndex := Yr - 2000;
  ShowComps(Year);
  YearInMemory := Yr;
  FillTempYearTable(yr);
  FrmMain2.tblHELec.active := true;
  frmMain2.tblDOLec.Active := true;
  dbGrid1.Options :=
    dbGrid1.Options + [dgRowSelect] + [dgMultiSelect];
  // make Grid fit panel
  dbGrid1.Left := pnlGrid.Left;
  dbGrid1.Width := pnlGrid.Width;
end;
    I think that it locks up in the first step, when it is filling the
ComboBox with integer strings.
    Thanks for sticking with this.
        Lloyd

"Alfred ten Hoeve" <Alfred.NoS...@SimpelProg.nl> wrote in message
news:3d28e132$0$225$4d4ebb8e@news.nl.uu.net...

Quote
> By accident I pushed the wrong button earlier this evening and sended this
> one to your personel address. Sorry for that.
> Alfred.

> Lloyd,

> see my lines between yours.

> Further this:
> I suppose you open the tables in the OnCreate event in your mainform.
> Can you show the code for that eventhandler and can you trace the line
where
> your app goes nuts?

> Hope this helps you a bit further,
> Alfred.

> ----- Original Message -----
> From: "Lloyd Edwards" <Llo...@sc.rr.com>
> Newsgroups: alt.comp.lang.borland-delphi
> Sent: Monday, July 08, 2002 1:09 AM
> Subject: Re: "Creating forms" revisited

> >     I'm not using a DataModule, and my tables are the standard Paradox 7
> > formats. One table is a source table for the others; at the beginning of
> the
> > program, a target table is filled with information from the source
table,

> Is the target table a temporary table, a ClientDataset or an InMemory
table?
> Is it filled with data before you open the detail tables?

> > and then three fields in the target table serve as master fields for
three
> > other tables, each of which displays a memo field keyed on the target
key.
> >     Hope this is clear enough. Still a mystery to me.
> >     On second thought, let me be more specific. I'm trying to calculate
> the
> > liturgical calendar for the Episcopal Church. The source table has all
the
> > major days, the Sundays, etc. The program uses those to fill a table
> called
> > TempYear, which has a record for each day of the year. Each record
> contiains
> > the name of the day as well as the color, a key for the collect for the
> day,
> > a key for the Eucharistic Lectionary, and a key for the Daily Office
> > Lectionary. Three other tables: one has a key and the text for the
> collect,
> > the next has a key and the text for Daily Office Lectionary, and the
third
> a
> > key and the text fo rthe Eucharistic Lectionary. Then I have three
DBMemos
> > on the form, one for each of the three, keyed on TempYear.
> >     Is there a limit on the number of memos, the number of tables, etc.?
I
> > haven't seen such in any of the documentation.

> No, only the amount of RAM is essential.

> >     I also once got a DBError that said the the BLOB had been changed.
> I've
> > not been able to find any documentation for that error, but I think the
> memo
> > fields are "really" BLOB fields.

> They are.

> >     Any help is greatly appreciated.
> >     Lloyd Edwards

Re:"Creating forms" revisited


Each time your mainform becomes the active form you add 50 items to your
combobox. That's no good design.
Put that code in a OnCreate-handler.
Or make a new (private) procedure doing the yob for you:

procedure TfrmMain2.FillCombobox;
var
    i : integer;
begin
    ComboBox1.Items.Clear;
    for i := 2000 to 2050 do ComboBox1.Items.Add(IntToStr(i));
end;

In your OnActivate-event delete the first to lines and add the line
FillCombobox;

But that can't be the problem 'cause you don't activate the form many times
at startup.

Try that and step another time through your code. You can skip the loop by
pressing F8 to fill the combobox.

You must try to track the bug down to a single line of code, using the
de{*word*81}.

Alfred.

Re:"Creating forms" revisited


Quote
Lloyd Edwards wrote in message ...

[...]

Quote
>  TabControl1.Tabs[0] := IntToStr(Yr);

Is there a ".Name" missing there?

Groetjes,
Maarten Wiltink

Re:"Creating forms" revisited


I finally tracked down the problem. I systematically tested the components
on my main form by setting their TTable references to ''. Then I added them
back one by one and noted when the program locked up. Turned out that two of
my detail tables had been corrupted.When I rebuilt them and reconnected
everything, voila! Worked beautifully.
    Thanks for the help.
        Lloyd

"Alfred ten Hoeve" <Alfred.NoS...@SimpelProg.nl> wrote in message
news:3d2b3284$0$235$4d4ebb8e@news.nl.uu.net...

Quote
> Each time your mainform becomes the active form you add 50 items to your
> combobox. That's no good design.
> Put that code in a OnCreate-handler.
> Or make a new (private) procedure doing the yob for you:

> procedure TfrmMain2.FillCombobox;
> var
>     i : integer;
> begin
>     ComboBox1.Items.Clear;
>     for i := 2000 to 2050 do ComboBox1.Items.Add(IntToStr(i));
> end;

> In your OnActivate-event delete the first to lines and add the line
> FillCombobox;

> But that can't be the problem 'cause you don't activate the form many
times
> at startup.

> Try that and step another time through your code. You can skip the loop by
> pressing F8 to fill the combobox.

> You must try to track the bug down to a single line of code, using the
> de{*word*81}.

> Alfred.

Re:"Creating forms" revisited


Good to read your problem is solved.

Alfred.

Other Threads