Welcome! Log In Create A New Profile

Advanced

[WD23] Automatic data modification

Posted by Ola 
Ola
[WD23] Automatic data modification
April 22, 2019 03:22PM
Hi all,

The Automatic data modification usually works like a dream, but:

1) I am wondering, how can I add permanently a new directory in the list of directories to be searched for the modification, so that I don't need to add it everytime the Automatic data modification dialog opens? Do I have to edit the .REP file manually?

2) How/where can I open the Automatic data modification dialog again, without doing any changes in the analysis?

Best regards
Ola
Re: [WD23] Automatic data modification
April 22, 2019 04:34PM
Hi Ola,

this is my way to keep HFSQL database structures in sync with the analysis:

1 - Do not use REP-file management!
Add to your Project code:
HSetREP(False)

info: keeping several projects with similar databases on the same hard disk will end up in disaster - if .REP management finds the "other" databases!

2 - Use HModifyStructure(...) at a convenient place in project code, preferably directly after changing directory or changing connection:

WHEN EXCEPTION IN
HChangeConnection("*",MyConnection)
DO
// if error
EndProgram("HFSQL C/S: Fehler bei HChangeConnection aufgetreten !",HErrorInfo(hErrFullDetails))
END

IF NOT HModifyStructure("*",hmsNoCheck) THEN
Error("Fehler bei HModifyStructure aufgetreten!",HErrorInfo(hErrFullDetails))
END

This will keep the database of your application in sync with the analysis. It's your choice to use hmsNormal or, as I'm doing it, hmsNoCheck
There will be no window at all while restructuring! Ok, there will be a window if there's an error .. bt this is very unlikely!

For HFSQL Classic the code would be slightly different if you're using HChangeDirectory. As always, I'm using a pseudo-connection to the HFSQL Classic database because it's very similar to the HFSQL C/S way to connect.

MyConnection..User = "Admin"
MyConnection..Password = ""
MyConnection..Database = ""
MyConnection..Server = ""
MyConnection..Provider = hAccessHF7
MyConnection..Access = hOReadWrite
MyConnection..CursorOptions = hServerCursor+hDynamicCursor+hOptimisticCursor
MyConnection..ExtendedInfo = ""
MyConnection..CryptMethod = hCryptStandard
MyConnection..Source = NoSpace(MyPathToHFClassic)

IF NOT HOpenConnection(MyConnection) THEN
Error("HF Classic: HOpenConnection: ","Unable to connect to HF Classic-Dir: "+MyPathToHFClassic,HErrorInfo(hErrComplet))
RETURN
END

MyConnectionName = MyConnection..Name

// Die Verbindung aller Dateien einrichten:
WHEN EXCEPTION IN
HChangeConnection("*",MyConnection)
DO
// Fehler aufgetaucht:
EndProgram("HFSQL C/S: Fehler bei HChangeConnection aufgetreten !",HErrorInfo(hErrFullDetails))
END

IF NOT HModifyStructure("*",hmsNoCheck) THEN
Error("Fehler bei HModifyStructure aufgetreten!",HErrorInfo(hErrFullDetails))
END

Kind regards,
Guenter Predl
office@windev.at
Ola
Re: [WD23] Automatic data modification
April 23, 2019 02:34PM
Hi Guenter,

Thanks for the sample codes.

A couple of years ago I tried using HModifyStructure, but had some problems with it, so in code I have now again been using WDModfic.

Also, I remember reading complaints about HModifyStructure not handling the file links. Has this been fixed?

"keeping several projects with similar databases on the same hard disk will end up in disaster - if .REP management finds the "other" databases!"

I do not have many projects with similar databases, but I do have one project with many test databases, so
I would also like to use Windev's automatic file modification dialog the update all the different test data directories that I have on my development machine, and that I would like to manage and control so that I would not have to enter the data directories each time I make a data change.

Best regards
Ola
Re: [WD23] Automatic data modification
April 23, 2019 04:02PM
Hi Ola,

the "missing links" have been fixed, as I remember with v21, I did extensive tests then and they showed that HModifyStructure(..) was working fine indeed and therefore is reliable to use. I hope, nothing has been changed meanwhile!

If you're happy with .REP file management, it's just fine. I can remember that the .REP file treatment gave me some nightmares a few years ago. Since then I try to confine restructuring to a single set of data only.

Kind regards,
Guenter Predl
office@windev.at
Al
Re: [WD23] Automatic data modification
April 23, 2019 05:41PM
Hello Ola

I too have a lot of test data in separate folders. Each folder of test data is inside my "TestData" folder so updating them all is simple.
I do it manually using WDModfic and just set it to point at the upper level "TestData" folder and tick the box to run it on sub directories, so one run of WDModfic does them all.

Regards
Al
Ola
Re: [WD23] Automatic data modification
April 23, 2019 08:15PM
Hi Guenter & Al

Thanks for the hints.
It seem that editing a .rep file manually is a strict No-No. And editing it with WDOptimizer is very primitive indeed; one can only add one file at a time. No wildcards, no directory selection. Unless I'm missing something?

I found the place where to manually start the automatic data modification: it is in the "Analysis" tab of the top menu which is visible when the analysis is open. There the selection "Synchronization" opens the data modification dialog.

Thanks and best regards
Ola
Al
Re: [WD23] Automatic data modification
April 23, 2019 09:01PM
Hello Ola

I totally ignore the rep files.
For WDOptimizer I right click in the table and "Remove All" and then right click again and "Add all the directory files"

Regards
Al
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: