PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Problem with deply database
Problem with deply database
Débuté par Mimmo Ghiara, 20 nov. 2019 18:54 - 3 réponses
Posté le 20 novembre 2019 - 18:54
Hello everybody,
with great effort I managed to deploy my application but I have a problem with the HFSQL database server.
On the deployment server the data server has a different name than the one on the web server. When I launch the application it gives me an error because it looks for the server with the name of the development computer.
I thought the installation package would make this change
What can I do? do I have to change my program on the development computer and change all the calls?
Give me a suggestion
Thanks
Mimmo
Posté le 11 juin 2020 - 16:58
Hi Mimmo

I am currently also running into this issue (Not with HFSQL database server, but with SQLserver).
I developed using a local server but now I have to deploy the code on an other server at an other company.
I do have teamviewer access to run the deployment, but get an error that it tries to find the name of our local database server. How/where can I change the connection name?

Henk
Membre enregistré
5 messages
Posté le 11 juin 2020 - 17:08
Hi Mimmo,

Did you ever get this problem solved? I'm currently also running into this issue (Not with HFSQL server but with SQLserver).
I have a local SQLserver database server that I use for developing my webdev application. And tested deployment on a local IIS server. So far so good. But now I have to install the APP at a remote location (with teamviewer access). I created at the remote location an IIS server, an SQL server (with exactly the same database settings as we used during testing) But when I try to install my deployment package, it fails because it is searching for the database connection that we using in our internal network. I even deleted the connection settings in my development system and replaced it with a new connection configuration for the new location and atached the "old" analysis to it. However when I try to deploy this, on the new location I again get an error it can not find the name of our local SQL server.

Henk
Membre enregistré
5 messages
Posté le 29 juin 2020 - 14:58
I found the solution to this problem, with a little help of Fabrice Harari. The solution is you should remove the connection definition from the analysis. I added the connection again in code at the project top level:
MyConnection is Connection
MyConnection..User = "Database user"
MyConnection..Password = "Database Password"
MyConnection..Provider = hOledbSQLServer // Depends on your environment
MyConnection..Access = hOReadWrite // Or what you need

MyConnection..Server = "Your Database server"
MyConnection..Database = "Your Database"

IF HOpenConnection(MyConnection) == False THEN
Info(HErrorInfo(hErrMessage))
END
HChangeConnection("*", MyConnection)


You can make the Server/Database configuration more smart by providing the values for your development and your production environment with some kind of selection mechanism.

Henk