PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Migrating from HF Classic to HFSql Server (Wndev14)
Migrating from HF Classic to HFSql Server (Wndev14)
Iniciado por guest, 25,mar. 2015 06:34 - 8 respuestas
Publicado el 25,marzo 2015 - 06:34
Hi
I have an application where I use Changedir to process history records and current records simultaneously. I need to migrate to HFSql client server, where I can not use changedir any more.
Here is an example if the directory structure where for instance, through changedir I am accessing Accounts.fic in the “Current” directory, and “2013” and “2014….. 2002” directories while working with Cust in “Current” directory simultaneously. I am looking for the best solution/method to change this to work well in a HFSql client server where I cannot use the changerdir anymore. Can anyone give me a good solution to my dilemma please, I Would appreciate it. (I am using Windev14)
Thanks
Andre

Example of structure
Appdir
---Currentdir
-----Accounts.FIC
Cust.FIC

---Historydir
---2014dir
-----Accounts.FIC
Cust.FIC

---2013dir
-----Accounts.FIC
Cust.FIC

---2012dir etc.
Publicado el 25,marzo 2015 - 09:40
Hi,

First a question. Why do you have seperate accounts for seperate years. ? If you specify a table for the year and connect it to all other tables you can save the yearreverence in every file , this enables to filter on the year.

If you reallly must use this "Strage "feature. You could try making a new connection to a new dataset in hyperfile cs. This wouyld be, I guess, the hyperfile cs way to do it.

Hchangeconnection (2012), Hchangeconnection (2014) etc etc.

regards

Allard
Publicado el 25,marzo 2015 - 09:52
Hi Andre, i have exactly same situation. But i didnt use HFsql server.
Why You think u need to change it from HF classic. I am using HF classic on server and it works nice too.
Publicado el 25,marzo 2015 - 11:46
Hi André,

you can have a different DB for each year if you want, as stated by Allard, but it's a mistake to say that you cannot use hchangedir... It may not be the preferred method, but it DOES work with HF C/S if you follow these guidelines:
1. ALL directories must be SUB-directories of your main DB one
2. The hchangedir should use a RELATIVE path based on the main DB one

Best regards
Publicado el 25,marzo 2015 - 11:48
Hi Ivan

he is using HF C/S because HF classic is a VERY BAD IDEA with multi-users.. At any time, a simple windows update can and WILL change the oplock version+settings, and you will start having to reindex your Db all the time, or even loose data.

So you can say that it is working fine NOW, but please be advise that your data is currently in a very precarious situation

Best regards
Publicado el 25,marzo 2015 - 19:22
Hi André and Fabrice,

Fabrice thanks for advices, i ll try to implement it soon.

I couldnt find in Help that HChangeDir() actually makes directory if it doesnt exist.

I tested inside my application and HChangeDir() worked exactly same with Classic and SQL server database analysis.


Regards,

Ivan
Publicado el 25,marzo 2015 - 21:46
Hi Fabrice

I was looking for the best solution and I think you gave it to me, I am surprised that you say hchangedir will work in c/s when pc-soft hilite in their documentation that hchangedir is useless in c/s. Don't get me wrong, I know that you have many years experience in windev and I believe you and I accept your suggestion as the best solution of all. So provided the history files resides in sub-directories and hchangedir works with c/s in that way, then I dont need to change anything as my files that I want hchangedir to back and forth are in fact in sub-directories of my main DB called "current" (see example original post), then i don't have a problem at all and don't need to change any code when migrating to c/s. Do you agree Fabrice?

Thank you also Allard and Ivan, Don't you also think that Fabrice's gave me the best solution?

Thank you again
Best regards
Andre
Publicado el 25,marzo 2015 - 22:02
Hi Andre,

I'm just curious to know where you have read in the documentation that HChangeDir() does not work in C/S? <a class="ExternalLink" rel="nofollow" target="_blank" href="http://doc.windev.com/en-US/?3044168">http://doc.windev.com/en-US/&hellip;</a>

I know this possibility since years but I personally always preferred using different database names than playing around with directories. (This is a personal taste (and for access/security reasons), and I had no previous code-behavior to maintain and keep compatibility with.)

Best regards,
Alexandre Leclerc
Publicado el 26,marzo 2015 - 10:12
Hi Andre,

Yes Fabrice gave the best solution