Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 3 Jahren, 6 Monaten
Letzter Beitrag:
vor 3 Jahren, 6 Monaten
Beteiligte Autoren:
Fabrice Harari, Noel Tanti

Independant HFsql

Startbeitrag von Noel Tanti am 22.11.2014 07:45

Hi All

a bit of background:

data is on a remote server
hfsql server 19
WD 19
a query with a list of records
a form editing one of the records

need to :
I need to use independant hfsql becasue the user needs to edit / create more than one record at a time

when is on, the time to open a form is about double what it takes if it is off. The time in question is seconds but any extra secords gives a feel of sluggishnes and when the users need to be fast thenI have a speed problem.

I tried aliases, MDI parent / child.

Any ideas please?

as an aside this was not a problem in clarion as each screen would open its own buffers but am not sure how to accomplish the opening of several buffers pointing to the same file in windev.


Hi Noel

it's quite normal, as each independent context needs to open a new connection to the DB.

2 tricks you can use, depending on your application context:

1- continue to use independent contexts, but open one window in advance each time... When you use one, you open another in the background and have it ready.


2- Stop using independent contexts. Instead, do NOT rely on the buffer content. To do that:
- pass the record ID as a parameter to the window
- read the record in the init and IMMEDIATELY fill the fields with it's contents
- when doing the hmodify, start by reading the record again, set the fields and save.
- as the same user can not save two records of the same file at the same time, this prevent any conflicts.
- of course, if you need to, you can save the content of the record in a record type variable

I have been using this technique since WAY before independent context became available, and it works quite well

Best regards

von Fabrice Harari - am 22.11.2014 12:11
HI Fabrice

thanks for the reply.

I am not sure about the first opton but the second one will work.
I got used to filetoscreen and screentofile and forgot about unlinked fields and manuel assignment.

von Noel Tanti - am 23.11.2014 07:13
Hi Noel,

You said:
"I got used to filetoscreen and screentofile and forgot about unlinked fields and manuel assignment."

But that has NOTHING to do with my second method...

When in my form I read the desired record, I can immediately afterwards do a filetoscreen (I juts read the record from the file, why couldn't I?)... Same thing when I read the record AGAIN before saving it... ScreenTo File is absolutely usable.

The only difference in my code is that I read the record from the file when I need it's content, instead of relying on the fact that no other window used the file buffer for another record.

Everything else stays the same

Best regards

von Fabrice Harari - am 23.11.2014 15:33
Hi Fabrice,

you are right about the filetoscreen and screentofile. I just got a bit confuesed :)

one question : can one clone a window prgramatically or use the same window with an alias so that I do no have to copy the same window from the IDE?


von Noel Tanti - am 24.11.2014 11:02
Hi Noel,

yes you can... OpenChild and OpenSister both have an alias management system built in. Just read the details of the help fr it

Best regards

von Fabrice Harari - am 24.11.2014 13:20
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.