Board index » delphi » One program...multiple forms...multiple tables...

One program...multiple forms...multiple tables...

Hello, who can again help me out?

I have a (small) problem, concerning the next thing......

I have made one program in which i have to use three different tables from
one database(ms-acces).
The problem is: how do i connect the tables, so that each table synchronise
with all other tables.......
In ms-acces i can connect them easily with SQL, but can i do the same trick
in delphi 4css?
Must i use SQL stored proc?

I wanna be able to input/output data through the system.

Please help me!...

Friendly greetings, Andre Groeneveld

 

Re:One program...multiple forms...multiple tables...


It's going to depend on what you want to do as there are a number of
possibilities. Also, you'll also have to decide if you want tables to
refresh to the possibility that others on the network change the
database as this also makes for some increased complexity.

Here are a few possibilities.

1. If you're worried about master-detail relations, generally these
take care of themselves. However, there are exceptions. For example,
cascade deletes need to be hand coded if you're using the BDE. In
other words, if you delete the master record and you want the child
records to also disappear, this needs hand coding. Changing the link
field may require hand coding.

2. If you have 3 TTables all pointing to the same underlying table in
the database, then you'll likely have to code in refresh commands in
the appropriate place.

Can you give a little more detail about what you are trying to do?

Steve F (Team B)

Re:One program...multiple forms...multiple tables...


What am i trying to do?
Ok, i will try to explain...........

In the acces database i have divided the whole database into different parts
(tables) to keep easy track of the subject which is in the database. Inside
Ms-acces i have no problems with finding what i need.

However if i wanna call the database-tables in delphi, then i don't know how
to get easy acces to all tables in for example different forms!.
Must i create on every form a new database object/datasource and table, or
can i do something with the sql components?

Am i more clear now about what i want? Or do u need to know more?

Please help me......

friendly greetings, Andre Groeneveld

Quote
Steve Fischkoff (TeamB) wrote in message

<37c01972.14679...@forums.borland.com>...
Quote
>It's going to depend on what you want to do as there are a number of
>possibilities. Also, you'll also have to decide if you want tables to
>refresh to the possibility that others on the network change the
>database as this also makes for some increased complexity.

>Here are a few possibilities.

>1. If you're worried about master-detail relations, generally these
>take care of themselves. However, there are exceptions. For example,
>cascade deletes need to be hand coded if you're using the BDE. In
>other words, if you delete the master record and you want the child
>records to also disappear, this needs hand coding. Changing the link
>field may require hand coding.

>2. If you have 3 TTables all pointing to the same underlying table in
>the database, then you'll likely have to code in refresh commands in
>the appropriate place.

>Can you give a little more detail about what you are trying to do?

>Steve F (Team B)

Re:One program...multiple forms...multiple tables...


There are really a lot of options here. The simplest is to use a
different TTable or TQuery for each different view of the data you
want. That's easy but may use more resources than necessary depending
on how many you use. You can use parameterized queries if the
structure of the query changes and it's just the parameters that vary.
You can use one TQuery but change the query as needed from text stored
or generated in the program. You can change the properties of TTables.

I can't really be more specific since all these methods can do some
aspect of what you asked for. Can you give one or two specific
examples of data views you might want?

Steve F (Team B)

Other Threads