PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → How to move from classic to client/server
How to move from classic to client/server
Iniciado por guest, 16,sep. 2016 13:49 - 5 respuestas
Publicado el 16,septiembre 2016 - 13:49
Dear fellow windev developers,

I am hoping someone can help point me in the right direction with an issue when changing database table connections.

I have an application that uses a hyperfile classic analysis with files locally in the executable directory. This all works absolutely fine. Within this analysis I have links for relationships between some of the tables.

I want to change the source location for 95% of these tables to a HFCS Client/Server which I have already setup and with the following commands I am able to do this for any table that has no links.


Server is Connection

// Parameters of the connection
Server..Provider = hAccessHFClientServer
Server..User = "Admin"
Server..Password = ""
Server..Server = "RLSXPS1:4900"
Server..Database = "FRM"
Server..CryptMethod = hCryptNo

// Opening the connection
IF HOpenConnection(Server) = False THEN

Info(HErrorInfo(hErrFullDetails))

END

IF HChangeConnection(FreeText,Server)= False THEN

Info(HErrorInfo(hErrFullDetails))

ELSE

HChangeDir(FreeText,".")

//Info("New Connection",HNbRec(FreeText))
IF HCreationIfNotFound(FreeText) = True THEN

FreeText.FreeText = "TEST"
HAdd(FreeText)

END


END

However when we try to perform this task on a table that has links we get the following error:-

Error at line 24 of Global Procedure DatabaseConnect process.
HCreationIfNotFound function called.
The constraint for referential integrity links a file found on a HFSQL server to a file that does not use the Client/Server mode. This is not allowed.

Can anyone offer some advice on how to resolve this please?

Thank you for any assistance,

Lee Shroder
Publicado el 16,septiembre 2016 - 14:20
Hi,

Indeed, it is not possible to use a integrity constraint between a classic file and a file in client/server mode.
This is because :
- in classic mode the integrity rules are checked by your application executable itself
- in client/server mode the integrity rules are checked by the database server itself

Kind regards,
Joris.
Publicado el 16,septiembre 2016 - 14:29
Hi Joris,

Thank you for your response, however the final desired result is to move all tables that have constraints to the client server. The only tables I want to hold locally are standalone tables. Is this not possible?

Kindest Regards,

Lee
Publicado el 16,septiembre 2016 - 15:04
Hi Lee

of course it is possible...

just :

1. deactivate integrity management
2. loop on all files
3. reactivate integrity management

Fully functional example available in clWXR_DB:InitDB of WXReplication

Best regards
Miembro registrado
2 mensajes
Publicado el 16,septiembre 2016 - 15:16
no its possible
u just have to change the type of the files from the context menu->file description and select the connextion
:)
Publicado el 16,septiembre 2016 - 16:18
Thank you so much Fabrice for pointing me in the right direction, my headache has now all gone thanks to your guidance :)

Lee
:cheers: