HFSQL with no pre-defined connection

Startbeitrag von Donald Montaine am 11.01.2018 23:30

What is the best way to set up a system that logs into one of several remote HFSQL CS
identical database servers based on the configuration in a local file. Right now I just change data.myhost.com in the client hosts file to point to the server I want. The connection in the analysis just says to connect to data.myhost.com.

Antworten:

Hi Donald,

1. don't define any connection in the analysis
2. Define all your files in the analysis as HF CLASSIC
3. In the project init code, point otward the server you want with a hchangeConnection. Generally this is done by reading an ini file, but yo can do that anyway you want

Best regards

von Fabrice Harari - am 12.01.2018 00:09
Thank you Fabrice

I just assumed that the analysis had to match the target. Didn't realize that a Classic analysis could be used with a client server database.

von Donald Montaine - am 12.01.2018 16:16
Hi Donald

any type of file in the analysis can be matched with any other type of file in execution... AS LONG AS you don't use something that is specific to an environment (by example, arrays of item are hf specific, timestamp don't work on all platform, and so on).

The analysis is just a logical structure definition... It is NOT a database...

Best regards

von Fabrice Harari - am 12.01.2018 17:52
OK - Here is what I came up with to match my needs:

In the analysis I have created three connections

LocalClassic is a local classic database with the files stored in the application directory
LocalServer is a local HFSQL/CS database on my development computer
RemoteServer is an HFSQL/CS database on another computer. Right now it is a computer on my local network, but could be anywhere on the internet.

I have attached the code I use in the initialization section of the project and a screen shot of the selection window if no connection name is found in the .ini file.

Any comments or suggestions are appreciated. This code works as designed, but one interesting anomaly is that the local classic files always get created in test mode, but once the exe is created and run, they do not get created unless the local classic database is chosen.

[attachment 2562 Code.JPG]

[attachment 2561 Window.JPG]

von Donald Montaine - am 13.01.2018 00:14
as I was saying, your problem is that you are creating connections in the analysis...

REMOVE ALL connections from the analysis, and define them BY CODE ONLY...

This way, you will not have the following problems:
- HF classic files created when they shouldn't
- 30 sec or more of waiting at startup because the program is trying to reach an unreachable server (define in the analysis but not reachable when deployed)
- ...


Best regards

von Fabrice Harari - am 13.01.2018 11:50
Thanks. I am planning to do that in the final deployed version. While testing I just did it this way for convenience and to understand better how connections work.

von Donald Montaine - am 13.01.2018 15:18
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.