Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 5 Jahren, 1 Monat
Letzter Beitrag:
vor 5 Jahren, 1 Monat
Beteiligte Autoren:
Michael Drechsel, ICI, GuenterP, Yogi Yang

How to change over from HF Classic to HFCS

Startbeitrag von Yogi Yang am 31.05.2013 05:18

In a software that I have almost completed which is developed using HF Classic as backend.

Now is it possible to change over to HFCS?

One of the feature of the software that I will be adding is that my software will create a set of data files dynamically (by coding) and populate them with some base data in a separate folder (in case of HF Classic) under certain situation.

Would something like this be possible (using coding) after converting/switching over to HFCS?


Yogi Yang


Hi Yogi
First, you can try to understand this , from windev solutions:
Windev Solutions

OR, you can try with this code below (Remember: You keep your analisys HF)

gctMyConnection is Connection
gsPathToDatabase is string

//You can put information about connection type into registry/INI,...
//And than change connection of your HF to HFCS,...
//gsPathToDatabase = NetMachineName()
//gsPathToDatabase = ""
//gsPathToDatabase = "MyCompany.no-ip.org"
IF sConnectionWay="HFCS" THEN
gctMyConnection..User = "Admin"
gctMyConnection..Password = ""
gctMyConnection..Database = "YourDatabaseName"
gctMyConnection..Source = gsPathToDatabase+":4900"
gctMyConnection..Access = hOReadWrite
gctMyConnection..Provider = hAccessHFClientServer
gctMyConnection..CursorOptions = hServerCursor+hDynamicCursor+hPessimisticCursor
//gctMyConnection..Compression = True
//gctMyConnection..ExtendedInfo = ";Encryption = none;Initial Catalog=MyDatabase"
//Lokalno spajanje
gctMyConnection..User = ""
gctMyConnection..Password = ""
gctMyConnection..Database = "MyDatabase"
gctMyConnection..Source = gsPathToDatabase
gctMyConnection..Access = hOReadWrite
gctMyConnection..Provider = hAccessHF7
gctMyConnection..CursorOptions = hServerCursor+hDynamicCursor+hPessimisticCursor
//gctMyConnection..Compression = False
//gctMyConnection..ExtendedInfo = ";Encryption = none;Initial Catalog=MyDatabase"

IF NOT HOpenConnection(gctMyConnection) THEN
Info("Problem with connection !")

von ICI - am 31.05.2013 15:07

BTW, I have never used "..cursoroptions".

Could you please explain whats the difference between using or not using this parameter ?

von Michael Drechsel - am 31.05.2013 17:34
Hi Michael
..CursorOptions is the way data records are managed, especialy in HFCS mode.

hServerCursor Cursor managed by the database. This cursor can easily apply the changes performed by the other users to the data.

hPessimisticCursor The record is locked as soon as it becomes in edit to be modified.

hDynamicCursor Cursor offering a lot of features but consuming a lot of memory. This cursor allows all types of moves. It enables you to access all the modifications, additions and deletions performed by the other users.

If you are not use this options and your database work then you probably wont need this. My database also work without this, but I want to optimise use of HFCS.

von ICI - am 01.06.2013 07:55

yes that can we read in the help.

But what is the effect ? Is it faster to have the cursor at workstation and if yes, what are the side effects ? What means "pessimistic" ? What is the advantage in relation to "optimistic" ?

von Michael Drechsel - am 01.06.2013 08:49
Hi Michael,

see: http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking

von GuenterP - am 01.06.2013 09:13
Hi Michael,
I really don't understand what is problem to understand description from Help.
It means what there is writed. OK, I will try to explain closer with sample.

When you use "pesimistic" you exclusive lock record and do not think about what was betwen you read record and what is when you push "Save record" button. Other userscan not change record when you open it in "pesimistic" read "Exclusive lock" record.
If you use Optimistic then you open record in shared mode and need to care about what is last modification when 2 users change same data and only last modification is verified and become actual.

ClientCursor eat much more memory when work with data and that explicitely mean slower performance when more data/query's,... are opened in same time,...

Which means "YES" if cursor is only on server side and not transfered to all clients probably will be faster situation. Maybe one or two tests can not make clear situtation but 24/7 can be good test.

P.S. Some stuff is hard to explain. Better is try and make your choice. Much more situation when you working with data pesimistic is "must have" choice....

von ICI - am 01.06.2013 11:23

thx. I wondering why in the Help is no hint which settings are the "default" settings.
I guess "optimistic" and "servercursor"

von Michael Drechsel - am 01.06.2013 13:51
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.