PDA

View Full Version : Unrelated Database & Tables



David C. Moody
29-Apr-2005, 10:22 AM
I have a table that is using 2 related databases. That is working fine.
The table shows general information then there is a non-focusable
entry form that shows more information.

Here's where the problem comes in, I have information in a non-related
database that I want to show in another entry_form.

Is there any way to perform this so they everytime they change records
in the table that the non-related entry form is updated as well?

Thanks!
-David

David C. Moody
29-Apr-2005, 10:41 AM
I spoke too soon!

This is what I just found and it works fairly well. Using the
set_relate command I can set the relation on a per instance basis and
not have to add the relation in the data file.

So I have:

set_relate child.child_field to parent.parent_field


And everything works.

Are there any reprocussions to using this method? Anything I should
know of other than not to use "zerofile" while using "set_relate".

Thanks!
-David

David C. Moody wrote:
> I have a table that is using 2 related databases. That is working fine.
> The table shows general information then there is a non-focusable entry
> form that shows more information.
>
> Here's where the problem comes in, I have information in a non-related
> database that I want to show in another entry_form.
>
> Is there any way to perform this so they everytime they change records
> in the table that the non-related entry form is updated as well?
>
> Thanks!
> -David

Sture Andersen
29-Apr-2005, 11:04 AM
That it remains in effect during the running of your application. It may
affect non-suspecting RELATE commands elsewhere in your code.

I don't know if it survives during the termination of a CHAIN WAIT
EXPORT_FILES or EXPORT_ONLY
-Sture

Sture Andersen
29-Apr-2005, 11:06 AM
.... and non-suspecting ATTACH commands. The SAVE command (unlike the
SAVERECORD command) has an embedded ATTACH in it.

chuck atkinson
6-May-2005, 10:04 AM
David,

You can also do what is generally referred to as 'soft relates'. In the DSO
object (or class) you can add the something like the following ...

Procedure Relate_Main_File

if refmstr.account_number ne "" begin
clear costacct
move refmstr.account_number to costacct.account_code
find eq costacct.account_code
if [found] send request_relate costacct.file_number
else send request_clear_file costacct.file_number
end
forward send relate_main_file
End_Procedure

Procedure Clear_Main_File
Forward Send Clear_Main_File
send request_clear_file costacct.file_number
End_Procedure

HTH
Chuck Atkinson

"David C. Moody" <davidm@holidaytoursinc.com> wrote in message
news:sGfC#GNTFHA.4428@dacmail.dataaccess.com...
> I spoke too soon!
>
> This is what I just found and it works fairly well. Using the
> set_relate command I can set the relation on a per instance basis and
> not have to add the relation in the data file.
>
> So I have:
>
> set_relate child.child_field to parent.parent_field
>
>
> And everything works.
>
> Are there any reprocussions to using this method? Anything I should
> know of other than not to use "zerofile" while using "set_relate".
>
> Thanks!
> -David
>
> David C. Moody wrote:
> > I have a table that is using 2 related databases. That is working fine.
> > The table shows general information then there is a non-focusable entry
> > form that shows more information.
> >
> > Here's where the problem comes in, I have information in a non-related
> > database that I want to show in another entry_form.
> >
> > Is there any way to perform this so they everytime they change records
> > in the table that the non-related entry form is updated as well?
> >
> > Thanks!
> > -David