Recent

Author Topic: [SOLVED] Firebird Connection problem  (Read 9848 times)

incendio

  • Sr. Member
  • ****
  • Posts: 269
[SOLVED] Firebird Connection problem
« on: January 23, 2019, 08:30:30 am »
Hi guys,

I tried to connect to remote Firebird database using TSQLConnetor.

On Object Inspector, I fill these value :
  • ConnecorType = Firebird
  • DatabaseName = My_db
  • HostName= server_ip
  • Password= ****
  • username= user
  • LoginPrompt= False

When tried to changed Connected value to True via Object Inspector, got the error :
TIBConnection : DoInternalConnect : - connection shutdown

But when run the app and tried to open database and query via these codes :
Code: Pascal  [Select][+][-]
  1. procedure TMainFrm.FormCreate(Sender: TObject);
  2. begin
  3.   ConnDb.Open;
  4.   QBrcd1.Close;
  5.   QBrcd1.Open;
  6. end;
  7.  

It was run OK.

Why can't set TSQLConnector to Active via Object Inspector? What's the problem here?

« Last Edit: February 05, 2019, 05:42:36 am by incendio »

BSaidus

  • Hero Member
  • *****
  • Posts: 545
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: Firebird Connection problem
« Reply #1 on: January 24, 2019, 01:28:42 pm »
did you copy fbclient.dll to your system directory or the fbclient.dll is located on the same directory as your application.

Hi guys,

I tried to connect to remote Firebird database using TSQLConnetor.

On Object Inspector, I fill these value :
  • ConnecorType = Firebird
  • DatabaseName = My_db
  • HostName= server_ip
  • Password= ****
  • username= user
  • LoginPrompt= False

When tried to changed Connected value to True via Object Inspector, got the error :
TIBConnection : DoInternalConnect : - connection shutdown

But when run the app and tried to open database and query via these codes :
Code: Pascal  [Select][+][-]
  1. procedure TMainFrm.FormCreate(Sender: TObject);
  2. begin
  3.   ConnDb.Open;
  4.   QBrcd1.Close;
  5.   QBrcd1.Open;
  6. end;
  7.  

It was run OK.

Why can't set TSQLConnector to Active via Object Inspector? What's the problem here?
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Firebird Connection problem
« Reply #2 on: January 25, 2019, 05:59:48 am »
Yes, I did.

BSaidus

  • Hero Member
  • *****
  • Posts: 545
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: Firebird Connection problem
« Reply #3 on: January 25, 2019, 09:33:33 am »
Then Put fbclient.dll on the same directory as your lazarus.exe
if your lazarus is located in C:\lazarus
 then put fbclient in C:\lazarus\fbclient.dll

It must work.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Firebird Connection problem
« Reply #4 on: January 25, 2019, 11:23:53 am »
I put fbclient.dll in these folder :

1) Window\system32
2) Windows\systemWow64
3) same folder with lazarus.exe
4) same folder with the app

None worked. I also tried not to fill password & username, the error message is the same.

Btw, I using Lazarus 1.8.4 32bit on Windows 64 with Firebird 3.0.4 64, could it be the caused of the problem?

« Last Edit: January 25, 2019, 11:39:12 am by incendio »

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Firebird Connection problem
« Reply #5 on: January 25, 2019, 11:38:19 am »
I put fbclient.dll in these folder :

1) Window\system32
2) Windows\systemWow64
3) same folder with lazarus.exe
4) same folder with the app

None worked. Btw, I using Lazarus 1.8.4 32bit on Windows 64, could it be the caused of the problem?
Yikes, don't (EVER) put the same fbclient.dll in system32 and SysWOW64.
The system32 is for 64bit versions and the SysWOW64 is for 32bit versions. Don't mix them.

Remove all manually added versions and install the client in the correct way.
Chances are the wrong version is used now for lazarus.exe.

After removing any trace and reinstalling the client-version properly, it should be available for both your app.exe and lazarus.exe.

B.T.W. the client doesn't install fbclient in system32 and SysWOW64 anymore, it adds a registry entry in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs


incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Firebird Connection problem
« Reply #6 on: January 25, 2019, 11:50:07 am »
What do you mean by install Firebird Client? I always use Firebird*.exe to setup on Windows and on installation process just click NEXT, everything leaves as default except for password for sysdba.

What I don't understand is why connection via code works without a problem?

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Firebird Connection problem
« Reply #7 on: January 25, 2019, 12:35:39 pm »
You said you connected to a remote server.
You installed the Firebird*.exe into the client?
(default serverinstallation will install the client too so that should be ok)

What version of Firebird is installed on the remote and what version did you install on the client?

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Firebird Connection problem
« Reply #8 on: January 25, 2019, 12:43:49 pm »
On a remote : Firebird 3.0.3
On client : Firebird 3.0.4

Connect locally gave the same error.

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Firebird Connection problem
« Reply #9 on: January 25, 2019, 01:10:59 pm »
Firebird 3 will install fbclient.dll automatically to system32 and SysWOW64 (the correct one in each directory, NOT the same).

So, if you have no fbclient.dll in your app directory, it should take the correct one from SysWOW64. Lazarus 1.8.2 33 bit should do the same (if there is no fbclient.dll in the lazarus.exe directory).

And I think it does locate the fbclient.dll and uses it, otherwise you would get an exception saying it can't find/use fbclient. So I'm puzzled as why it doesn't work.

You did use the complete path+databasename in databasename?

Does the TIBConnection give the same problems?

(O, and try disabling your firewall temporarily on the client)
« Last Edit: January 25, 2019, 01:13:46 pm by rvk »

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Firebird Connection problem
« Reply #10 on: January 25, 2019, 01:59:08 pm »
I tried with complete database path & database alias, none worked.

The point is, connection by code works fine.
If there is something wrong with fbclient or firewall, connection by code won't work.

Could it be the bug in Lazarus?

Has someone here able to set connection to Firebird via object inspector?

rvk

  • Hero Member
  • *****
  • Posts: 6162
Re: Firebird Connection problem
« Reply #11 on: January 25, 2019, 02:21:31 pm »
Has someone here able to set connection to Firebird via object inspector?
Yes, I've just tried that in a VM with Windows 7 and Lazarus 1.8.2 32 bit.
Connecting to a remote server running Firebird 3.0 worked fine in the IDE with TIBConnection and TSQLConnector.

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Firebird Connection problem
« Reply #12 on: January 25, 2019, 03:01:35 pm »
TIBConnection?

I don't use this. I thought since activated TSqlConnection via code works, this component is not needed.

I will try to add that component when I get around on my computer and see the result.

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Firebird Connection problem
« Reply #13 on: January 26, 2019, 03:06:32 am »
Today, I turn on computer, start Lazarus and create a new project.

Add TSQLConnector, set its properties, and set Connected properties via Object Inspector and it worked!

But, as I wrote this post, I tried again to set Connected properties on and off, and the error came back!

Close again Lazarus, start new project & do the same, set Connected to True and it work again! Tried On/Off a couple time, still worked.

Very strange, I don't know why it works, still a mystery.
My environment :
  • Lazarus 1.8.4 32 bit
  • Windows 64 bit pro
  • Firebird 64 bit client, Firebirs 3.0.3 Server

I will mark this post as SOLVED for now, will open again if problem reappeared again.

Thanks to all that have been help me.

Btw, for connection to database, I only use TSQLConnector, never use TIBConnection.

incendio

  • Sr. Member
  • ****
  • Posts: 269
Re: Firebird Connection problem
« Reply #14 on: January 27, 2019, 06:12:03 am »
Hi, sorry guys, have to reopen again the problem.

Problem still exist !

Sometimes, set Connected property via Object Inspector works, sometimes, not work, it is very random.

Whenever, Connection raised an error, restart Lazarus and start again could give a success.

Where is the wrong? Is it from Lazarus or from Windows ?
« Last Edit: January 27, 2019, 06:20:33 am by incendio »

 

TinyPortal © 2005-2018