For Programmers: Free Programming Magazines  


Home > Archive > Clarion > March 2004 > Update TPS file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Update TPS file
Leonard

2004-03-26, 11:00 pm

Hi

How do I update a TPS file from another? We have tests that are conducted at
various sites and when back at HQ they have to merged into the the main
database. Is there a script or some other way that this can be done?

Thanks.

Leonard


Phil Lancaster

2004-03-26, 11:01 pm

Following sent in response to email but posted here for further comment:

Start building your procedure by selecting Defaults and then A Process
Procedure from the Application Builder Class templates.



Select Tables, click on <ToDo> and select your Transaction File. Then click
on Edit and select the key to read it by. Select Other Tables and add your
master file.



You can click on OK. This will give you a basic procedure that will read the
transaction file and display the progress. Opening and closing of the master
file will also be handled.



You may want to tidy up the window to reflect your own look and feel.



Click on Embeds. Find the TakeRecord Procedure and embed your code just
after the parent call. I'm assuming there's a field in each transaction
record that can be used to find the corresponding master record. Something
like:



MAS:Key = TRN:MatchField

IF Access:MasterFile.Fetch(Key)

Access:MasterFile.PrimeRecord() !Clears the buffer and
auto-increments key

!Build master record from transaction

Access:MasterFile.Insert()

ELSE

!Update master record from transaction

Access:MasterFile.Update()

END



"Leonard" <leonardg@otb.co.za> wrote in message
news:c1kn1m$og9$1@ctb-nnrp2.saix.net...
> Hi
>
> How do I update a TPS file from another? We have tests that are conducted

at
> various sites and when back at HQ they have to merged into the the main
> database. Is there a script or some other way that this can be done?
>
> Thanks.
>
> Leonard
>
>



Phil Lancaster

2004-03-26, 11:01 pm

I'm not aware of any script for doing this but it should be fairly simple to
use a process template to read the transaction file, giving you an automatic
progress bar, and then in the action taken for each record, match the key to
the main database (i.e., fetch the record with the corresponding key) and
update it from the transaction, or create a new record and insert it if
there's no match. If I'm on the right track and you want sample code, let me
know.

Although I haven't used it, I think Capesoft have a product for
synchronising databases and it may be just what you want. Their products are
generally both excellent and well documented.

"Leonard" <leonardg@otb.co.za> wrote in message
news:c1kn1m$og9$1@ctb-nnrp2.saix.net...
> Hi
>
> How do I update a TPS file from another? We have tests that are conducted

at
> various sites and when back at HQ they have to merged into the the main
> database. Is there a script or some other way that this can be done?
>
> Thanks.
>
> Leonard
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com