Jump to content
bazzer747

Target machine actively refused connection

Recommended Posts

Hi,

 

Whilst I've used Firedac for some while now I've never tried to use Interbase with it. My normal connectivity, both local and on remote servers, is using MSSQL.

 

However, with some time on my hands I've decided to go through Cary Jensen's Delphi in Depth: FireDac book which uses Interbase throughout. But ... at the first hurdle I'm stopped. I've created a new VCL project with a data modele, and on it placed a FDConnection. In the parameters I've set it to a IB driver, pointed it to the EMPLOYEE.GDB, added User_Name and Password, and set Server to 127.0.0.1.

 

When I Test this connection I get ..Unable to complete network request to host !localhost/305" ... target machine actively refused it. 

 

Googling this I've seen lots of different thoughts but few that pertain to Delphi 10.4.1/InterBase 2020 which I have installed or don't appear applicable. I've disabled my anti-virus products in case they were blocking this connection.

 

Any suggestions would be appreciated - I'm not a Windows guru, which maybe is what is needed to allow this connection.

IBConnectionError.jpg

Share this post


Link to post
Guest
3 hours ago, bazzer747 said:

Any suggestions would be appreciated - I'm not a Windows guru, which maybe is what is needed to allow this connection.

hi @bazzer747

 

follow me:

your Interbase Server is running ok? normally on PORT 3050 (normally released for use) if you not change on installation or by changes on setup file.



image.png.cb07d2b675e80e0e891bb0b9a2accd93.png


for a Interbase Connection by FireDAC you needs just 3 components, basically - no talking about FDManager, FDTransactions and others not necessars at all
FDGUIxWaitCursor -> 
FDPhysIBDriver
FDConnection
any other can be used in specific cases. ok?



image.png.c4f3d26e666ae741156813f421130dbc.png


Protocol = TCP/IP
Server - prefere use the "IP address" same in localhost
Port - 3050 or any other used by IB Server
and Login credencials, of course!



image.thumb.png.57259e2e69651100e59b15388adca61c.png


out that, not it's really necessar config your Firewall or Antivirus, at general
only in specific case, if your system take control of all, like a "environment paranoic"


it's ready nothing more than this.


on Client app, maybe be necessary config the Client Lib if it dont stay on same folder than your EXE

  • take note: in VendorHome just put the path where the "DLL" is it. and VendorLIB = just lib name.dll
  • when using Firebird, this 2 properties have a "particular bug", mainly, later first definition in DesignTime and Runtime
  • type use>    "...\ClientXXXlib.DLL" on  VendorLIB, because the "VendorHome" stay like "xxxxPath\BIN" and "BIN part is repeated on VendorLIB" you see?

 

hug

Edited by Guest

Share this post


Link to post

Hi,

 

Yes, I have Interbase Server running - called developer_ib2020. And in the FDConnection it's almost exactly like yours:

FDConnection.thumb.jpg.02563b8db239ed649dd9448c6fda8022.jpg

I did changed Protocol from 'local' to TCP/IP but made no difference (and Server from localhost to 127.0.0.1).

On your last point - VendorHome and VendorLib properties, which DLL are you referring to?

 

 

IBServer.jpg

Share this post


Link to post
Guest
44 minutes ago, bazzer747 said:

VendorHome and VendorLib properties, which DLL are you referring to?

when deploys in your APP, some Database need deploys the xxClientLIB.DLL (MSWin)/.SO (linux), like "gds32.dll and  interbase.msg for IB use" on Interbase, FBClient.dll on Firebird, etc...

of course, when in PC Develpment this files is installed by default when installing Interbase, Firebird, MSSQL Server, etc...

http://docwiki.embarcadero.com/InterBase/2020/en/Installation,_Registration,_and_Licensing_Information

 

see on C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBase2020

 

look, if you dont inform the "PORT", then, the engine IB will go use the default = 3050 or any other in your environment defined. 

Por that is always good pratice - you define in your project, for avoid any other value. you see?

 

good pratice: be on design o runtime (by code)

  • always that possible, use TCP/IP protocol
  • always that possible, use IP address (that way, avoid a "search by network... you see?"
  • always that possible, use define the PORT
  • etc...

 

image.thumb.png.c85430ac04b9fded5a1451568d22b98d.png

hug

Edited by Guest

Share this post


Link to post

So I am only in development on my PC, so when I installed Interbase I accepted all the defaults. This is why I'm a bit surprised that it doesn't work. It isn't that I'm doing anything complicated.

 

Connecting to MSSQL is so simple and works seamlessly, I've had no issues at all. Yet, with Interbase I am getting issues all the time.

 

No wonder I'm deciding not to use IB 🙂

 

What I have noticed, looking at Services, is the path to the executable is it points to the ..Program Files (x86)\Embarcadero\Studio\20.0\InterBase2020" -p developer_ib2020. So not the 21.0 directory (which is the 10.4 install). Could this be an issue?

 

Also, in the Log On tab there's a checkbox 'Allow service to interact with desktop' which was unchecked. Checking it makes no difference.

 

I'm thinking a good old uninstall/re-install to see if the previous installations have cross-contaminated each other ...

Share this post


Link to post
Guest
34 minutes ago, bazzer747 said:

I'm thinking a good old uninstall/re-install to see if the previous installations have cross-contaminated each other ...

you can have how many instance of Interbase in same MSWindows you need (include distinct versions)... just, each one should use "one specific port" nothing more!!!

  • of course, gds32.dll (normally used by all editions) always will be in "c:\windows\systemXX" folder, then, have it in your EXE folder to avoid have it in "..\systemXX" system folder

there is not any complication in install or use Interbase, is quite simple than use a BDE in old time! 

 

Of course, having a "port confict" this is another history with any software.

But, this is quite simple solve too!

 

For easy way, just re-install the Interbase and pay attention on this part! WHAT PORT USE!!!

image.thumb.png.7f1960c703759fd2caa4747d8a691d60.png  image.thumb.png.b8bf86245431854b423c70223bcfbd85.png

 

or just change the "Service file" on MSWIndows ..\Drivers\Etc folder as above

look at "interbase.log" on BIN IB folder for any error msg.

 

hug

Edited by Guest

Share this post


Link to post

Finally got it working. I think the problem was twofold - first I had IB Server 'developer_ib2020' running, and 'gds_db' wasn't running. I brought up IB Console and added 'gds_db' and created a new User. Then when I ran my application it connected successfully.

 

So another case of the error message not giving a clue as to where the problem lay. It was really that I'd never used the 'gds_db' server before and therefore it wasn't configured  correctly for use.

 

Still not sure technically why it didn't connect to the 'developer_ib2020' instance that was running.. Now I'm connected I'll dig deeper and maybe start to understand the configuration aspects of these different server instances.

 

Thanks all who responded to help me out. Really appreciated.

Share this post


Link to post
Guest

gds_db is a "alias" (nickname) default to IB port on installation, but you can:

use any other than this nickname to port choiced.

but really need always use a unique port, as in any other software in a universe of 1...64K

you see?

 

hug

Edited by Guest

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×