Welcome! Log In Create A New Profile

Advanced

Connection problem. Loss of connection

Posted by Willy 
Connection problem. Loss of connection
July 06, 2022 09:58AM
I have a very stange situation.
I use a version of software with this code

cUser is string = INIRead(“Connection”,“user”,“admin”,fExeDir()+“\settings.ini”)

cPW is string = INIRead(“Connection”,“PW”,“”,fExeDir()+“\settings.ini”)  // Password
cServer is string = INIRead(“Connection”,“server”,"",fExeDir()+“\settings.ini”) // IP address
cDatabase is string = INIRead(“Connection”,“database”,“BakKas”,fExeDir()+“\settings.ini”)

// Parameters of the connection
New_Connection..Provider = hAccessHFClientServer
New_Connection..User = cUser
New_Connection..Password = cPW
New_Connection..Server = cServer
New_Connection..Database = cDatabase
New_Connection..CryptMethod = hCryptNo
New_Connection..Access = hOReadWrite

I use this code in version 7 of my application.

I use exact the same code in the next version.

It is compiled with the same Windev.
It works in the older version but not in the new.

The program works on the local PC with HFSQL 127.0.0.1
From another PC like 192.168.1.25

Errorscreen says
The connection to the 127.0.0.1 server was interupted.
The variable cServer has the correct content. 192.168.1.26 for example.

I have tried to change the code like this
New_Connection..Server = "192.168.1.25"


But it gives the same error.
The firewall is disabled on both PC's

The Ping command works perfect.

When I set back the previous version, everything works fine. It uses the same settings.ini.

Someone an idea.

Thanks.

Willy Hermans
Thilo Rieger
Re: Connection problem. Loss of connection
July 06, 2022 10:41AM
Hi,

i am missing your Hopenconnection Statement. Are you sure that you have assigned the New_Connection Data to your DB. If Error says that 127.0.0.1 is interrupted, there is 127.0.0.1 assigned somewhere. Maybe in the analysis.

Thilo
Re: Connection problem. Loss of connection
July 07, 2022 09:33AM
This is what I use

// Parameters of the connection
New_Connection..Provider = hAccessHFClientServer
New_Connection..User = cUser
New_Connection..Password = cPW
New_Connection..Server = cServer
//New_Connection..Server = "192.168.1.150"
New_Connection..Database = cDatabase
New_Connection..CryptMethod = hCryptNo
New_Connection..Access = hOReadWrite 


HOpenConnection(New_Connection)

HChangeConnection(“*”,New_Connection)

I have 1 connecton in the analysys. It is the standerd HFSQL Client/Server MyConnection1
with 127.0.0.1
Re: Connection problem. Loss of connection
July 07, 2022 10:04AM
Hi Willy,

Try the following:
1. Try to see if there is an error at HOpenConnection(New_Connection)
2. Use HCreationIfNotFound("*") like this (after HChangeConnection) :

WHEN EXCEPTION IN
HCreationIfNotFound("*")
DO
info("your error")
EndProgram()
END

3. Make sure you are using the right version of the HFSQL engine
For v27 applications, you should use v27 (or newer) HFSQL server etc ..

4. Use wdmodfic to check your database files

5. Take a look at this post : [www.wxforum.info]

Regards
Steven Sitas



Edited 1 time(s). Last edit at 07/07/2022 12:35PM by SteveSitas.
Re: Connection problem. Loss of connection
July 07, 2022 01:42PM
Hi

Check your IP address first, if your IPV4 is on automatic, your IP address may have changed

[infosonline.net]
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: