0

I have an application (C++Builder, Delphi) and I connect to remote Interbase database via IBX (TIBDatabase).

When try to connect to database using network and the IP address dosn't exists, so the application freeze for 20 seconds until the error message (Unable to complete network request to host "172.16.1.144:3050". Failed to establish a connection.) appears.

I try to connect to remote database using a new thread, also the app freeze.

How can try to connect without freeze the whole app ??

Thanks.

3
  • 2
    Can you at least show how you are trying to connect in a thread?
    – Uwe Raabe
    Sep 26 at 8:48
  • Simply I add a new form to my app. and add TIBDatabase, and then show this form by a TThread object. and then when the form appears I try to connect the database with non exist IP address, the whole app freeze not just the form which is contains the IBDatabase component. Sep 26 at 9:16
  • 3
    Forms are not thread safe; almost no visible element is. You should create and connect a separate TIBDatabase instance inside the TThread.Execute method and try to connect. If that succeeds, you can connect the instance on the form in the main thread.
    – Uwe Raabe
    Sep 26 at 9:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.