Recent

Author Topic: Interbase 2009  (Read 11783 times)

lindaandjon

  • New Member
  • *
  • Posts: 12
Interbase 2009
« on: June 23, 2016, 07:50:14 pm »
Could someone confirm that Interbase 2009 SMP will or won't work with Lazarus 1.6 please?  I've read some documentation saying Lazarus is only compatible with 5/6 which I'm hoping is out of date?

if so, is there a guide to how to connect Lazarus to my Interbase databases anywhere please?

Many thanks

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Interbase 2009
« Reply #1 on: June 24, 2016, 12:55:19 am »
Lazarus doesn't include any Database specific connection components. They all come from the Free Pascal Compiler project. I'm fairly confident that using the SqlDB components will work with Interbase 2009 too.

The units in question will be:
  sqldb
  IBConnection

The components in those units will be:
  TIBConnection
  TSQLTransaction
  TSQLQuery

The Free Pascal Wiki has some pages on using SqlDB database components. The database units are also document by FPC (see the fcl.pdf)
« Last Edit: June 24, 2016, 12:27:01 pm by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: Interbase 2009
« Reply #2 on: June 24, 2016, 08:00:14 am »
I think, that it will work.
I have ran (some time ago) db test suite against Interbase XP and it worked
But this are all my experiences ...

lindaandjon

  • New Member
  • *
  • Posts: 12
Re: Interbase 2009
« Reply #3 on: June 25, 2016, 11:06:02 am »
Thanks, I can't figure out how to set up Lazarus to see the actual database though.  I've got a fully working database, and Lazarus with the IBConnection component but can't get it to connect to the database.  Do I need various Interbase .dll's rather than firebord ones?  As its a local machine do I leave Hostname blank?  And what is the format for pointing to the database on the component - does the select file dialog set it up correctly.  In my early Delphi days this had to be set up manually not using the dialog box for some reason and its that long ago I can't remember why - old age for you!  Thanks

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Interbase 2009
« Reply #4 on: June 25, 2016, 11:56:23 am »
Connecting to Interbase is the same as to Firebird as far as I know, but then I haven't used Interbase since Delphi 7 days. The connection string format is as follows:

Remote servers:
  <ip address>:<path to database>
  <ip address>:<database alias>

Local server:
  <path to database>
  <database alias>

Some components can figure out from the connection string if it is a local or remote database. For other connection components you need to set a property like "Local = true" or something.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Interbase 2009
« Reply #5 on: June 25, 2016, 12:05:59 pm »
I've got a fully working database, and Lazarus with the IBConnection component but can't get it to connect to the database.  Do I need various Interbase .dll's rather than firebord ones?
If you have a working Interbase server running on that machine, you don't need any firebird dll's. Actually you don't need any dll's in your application directory. If you have... remove them all. Interbase server should have installed a gds32.dll in the searchpath which will be used automatically. (Note: but you DO need the Interbase server installed on your machine). Check if you have gds32.dll in C:\Windows\system32 and C:\Windows\SysWOW64.

Quote
As its a local machine do I leave Hostname blank?
I'm not sure if connecting without hostname will work on Interbase. On (older) Firebird servers it worked and would create a local connection but with the last version this doesn't work anymore (I think). So always supply a hostname (unless you are using an embedded version, which you are not). You can use 127.0.0.1 or localhost as hostname. Fill in SYSDBA for username and masterkey as password (if that's how the Interbase server is set up) and the full-filename for databasename. After that it should work.

What error are you getting when you are trying to connect??

lindaandjon

  • New Member
  • *
  • Posts: 12
Re: Interbase 2009
« Reply #6 on: June 26, 2016, 10:28:23 am »
Thanks for all the replies.

My server is running and I've checked that I have gds32.dll in the places mentioned and also not in my project folder.  The database opens fine with my IbConsole and I can browse the data, restructure etc.

I've tried localhost and 127.0.0.1 and I get the following error with either setting

IBConnection1: DoInternalConnect
-Unable to complete network request to host "localhost"
-Failed to establish network connection

I'm running Windows 10 and using Delphi 7 I can connect to the database fine.  I'd just like to use Lazarus instead of my ancient D7!  I've also tried turning my firewall off too.

Many thanks for any help.
Jon
« Last Edit: June 26, 2016, 12:38:36 pm by lindaandjon »

rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Interbase 2009
« Reply #7 on: June 27, 2016, 12:35:20 pm »
What are you using as host to connect in Delphi 7?

You could try to leave hostname empty.

Also check if you don't have fbembed.dll and fbclient.dll anywhere in your searchpath. If FPC encounters one of those it won't use gds32.dll (which is needed for Interbase).

lindaandjon

  • New Member
  • *
  • Posts: 12
Re: Interbase 2009
« Reply #8 on: June 27, 2016, 06:22:46 pm »
Thanks.

I'm using a TIBDatabase component with the full name and path of the database listed in DatabaseName.  It works fine here.

I've tracked down an Fbclient.dll in the system32  directory and removed it and now I get an error saying
Can not load default Firebird clients (fbclient or gds32.dll or fbembed.dll) Check your installation.

I presume Firebird can't find the gds32.dll but I've tried putting it in system32 and it still gets the same error.

Any more ideas please?


rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Interbase 2009
« Reply #9 on: June 27, 2016, 06:28:57 pm »
I've tracked down an Fbclient.dll in the system32  directory and removed it
BINGO. That was the problem.

Quote
and now I get an error saying. Can not load default Firebird clients (fbclient or gds32.dll or fbembed.dll) Check your installation.
I presume Firebird can't find the gds32.dll but I've tried putting it in system32 and it still gets the same error.
Be very careful putting just a gds32.dll in the system32 directory. The system32 directory is for 64Bit dlls on a 64bit system. If you have 32bit Lazarus and a 32bit gds32.dll you need to put it in C:\Windows\SysWOW64 (confusing he %)).

So:
On 64bit Windows:
32bit Lazarus, put the 32bit gds32.dll in C:\Windows\SysWOW64
64bit Lazarus, put the 64bit gds32.dll in C:\Windows\system32

On 32bit Windows:
32bit Lazarus, put the 32bit gds32.dll in C:\Windows\system32

If you reinstall Interbase 2009 it should give you an option (on the last page) to copy a gds32.dll to the correct system-directories (at least, that's the case with Firebird, except the last one which requires also manual copying of gds32.dll).

Put when copying manually make sure to put the correct bitness (32/64) dll in the correct Windows directory.

lindaandjon

  • New Member
  • *
  • Posts: 12
Re: Interbase 2009
« Reply #10 on: June 27, 2016, 07:42:09 pm »
Sounds like we're getting there!

I'm running Windows 10 64bit, Lazarus 1.6 64bit and Interbase 2009SMP which I believe is 32 bit??.

Interbase doesn't copy the Gds32.dll so I've copied from Interbase/bin to system32 after reinstalling Interbase and deleting all existing copies of gds32.dll.

Sadly I still get the same error. 

Your guide didn't include Lazarus 64 windows 64 and Interbase 32, I assume this is the problem?  Is there a way around it possibly?

rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Interbase 2009
« Reply #11 on: June 27, 2016, 07:53:03 pm »
I'm running Windows 10 64bit, Lazarus 1.6 64bit and Interbase 2009SMP which I believe is 32 bit??.
Interbase doesn't copy the Gds32.dll so I've copied from Interbase/bin to system32 after reinstalling Interbase and deleting all existing copies of gds32.dll.
Your guide didn't include Lazarus 64 windows 64 and Interbase 32, I assume this is the problem?  Is there a way around it possibly?
My guide didn't include Laz64 on Win64 and Interbase 32bit because you need the 64bit dlls for Laz64.

If you copied gds32.dll 32bit into C:\Windows\system32 you need to remove it from there because that was a 32bit version of gds32.dll (wasn't it?). You can copy it to C:\Windows\SysWOW64 but Lazarus 64bit won't do anything with that because it really needs the 64bit version of gds32.dll.

If you can't find any 64bit drivers (gds32.dll) for Interbase 2009, you could try installing the client of InterBase XE7 64bit (make sure you choose client install and not server).

Or you could use Lazarus 32bit (in which case the 32bit gds32.dll from C:\Windows\SysWOW64 will be taken).

lindaandjon

  • New Member
  • *
  • Posts: 12
Re: Interbase 2009
« Reply #12 on: June 27, 2016, 09:34:38 pm »
Thanks again! 

I've tried the Interbase 64bit gds32.dll in the system32 and I still get the error. I've moved it to wow64 (which is where XE installed it to) and same error too.  With Interbase uninstalled you get the same error (unsurprisingly) but the speed you get the error with or without interbase installed is identical.  Does Lazarus need to be told where to look for the dll?

Maybe I should just move over to Firebird! 

rvk

  • Hero Member
  • *****
  • Posts: 6171
Re: Interbase 2009
« Reply #13 on: June 27, 2016, 09:43:01 pm »
I've tried the Interbase 64bit gds32.dll in the system32 and I still get the error. I've moved it to wow64 (which is where XE installed it to) and same error too.
If Interbase XE 64bit installed a gds32.dll to SysWOW64, it is the 32bit version. You shouldn't take that one. It should have installed another 64bit version in system32. Otherwise you could take the gds32.dll from the Interbase directory C:\Program Files\Interbase (not Program Files (x86) !!!). If Interbase installed itself to Program Files (x86) it's not the 64bit version.

(Never ever move DLLs from system32 to SysWOW64 and visa versa because system32 has 64bit versions and SysWOW64 has 32bit versions and they are not interchangeable... period)

Does Lazarus need to be told where to look for the dll?
No, not if the gds32.dll is in the searchpath (which C:\Windows\system32 is).

Quote
Maybe I should just move over to Firebird!
Yes. You could still try Interbase XE server or higher (which has a 64bit version). But I don't think it is free. And I'm not sure if you can upgrade from Interbase 2009.

If you're not stuck with Interbase for some reason, going to Firebird 2.5 server 64bit would be simplest solution.

So it's either Lazarus 32 bit with Interbase 2009
or Lazarus 64 bit with Firebird 2.5 64bit (or 3.0)
or Lazarus 64 bit with Interbase XE+ 64bit.

I'm also not sure why you would want a 32bit Interbase version but need to have Lazarus 64bit. In that case Lazarus 32bit would do just fine. And if you definitely want 64bit Lazarus (for some reason) you should also want a 64bit DB-engine.
« Last Edit: June 27, 2016, 10:07:54 pm by rvk »

lindaandjon

  • New Member
  • *
  • Posts: 12
Re: Interbase 2009
« Reply #14 on: June 27, 2016, 10:21:01 pm »
I stand suitably slapped for the moving dll's - lol.

In answer to your questions I'm familiar with Interbase and haven't really programmed since 2009, so it was just the database I had on hand that I know.  I had just downloaded Lazarus as its Delphi like (which I also am familiar with and D7 doesn't work properly on W10) but hadn't really clicked about the 64 and 32 bit stuff.  I never did anything in 64bit I'm so old and the brain's a bit rusty!

I'll have a play around now with all your suggestions.

Again, many thanks for taking the time to try to help me get this sorted, that's very kind of you and I really do appreciate it.

 

TinyPortal © 2005-2018