Interbase does not connect in Delphi 10.3.3 Rio - delphi

In the past, I have worked a lot with Delphi 7. I have two questions for Delphi 10.3:
Does the Interbase DB file have the extension .IB or .GDB, as in the past?
After having created a database with IBConsole, after having entered the DatabaseName property of the TIBDatabase component, I am never able to connect, I always receive the error "Unavailable Database". This also happens to me with the Delphi examples. I don't know what to think, maybe the problem is due to 32bit vs64bit of the system?

InterBase definitely works in 10.3
Regarding File Extension for InterBase.
You can name the file anything you want! InterBase use to use .gdb as the file extension, then Windows started using it for some files causing the OS to try and back those files up before use, and as you can imagine with large databases, that was a pain! So InterBase swapped to .ib as the default extension to avoid that issue.
Which version of Interbase are you using? Hopefully, the latest that comes with the product. It's unlikely to be a 32bit / 64bit issue. InterBase clients can connect to any InterBase server as it uses an over the wire protocol, separate to the OS version. You could be connecting to Linux from Windows, it really doesn't care.
The problem is likely to be InterBase isn't running, or the pathing is incorrect.
If you can connect in IBConsole, then you will be able to connect inside the IDE.
For the database name, just put in the local file path.
Depending on the settings, you might want to put in the full path including IP / server name e.g.
127.0.0.1:c:\mydatafolder\mydatabase.ib
InterBase uses server name or IP, a colon (as the separator) and then the file path on the machine indicated.
If you find you can't connect in IBConsole, restart InterBase using IB Server Manager.
If you are using an OLD version of InterBase, you can download the latest from inside RAD Studio by using Tools > Manage Platforms > Additional Options and selecting the developer edition from the list of options.

Related

Connecting Delphi 10.1 to Interbase XE7 Desktop in the Rad Studio Development Environment

I wanted to use the Desktop version of IB XE7 in my development environment but can't get the connection to work.
The original app had used a full server version of IB and I now wanted to run the app on a lower cost single PC type application and selected the IB Desktop version.
The Rad Studio 10.1 Berlin is running on a W7 64bit Virtual machine.
FireDac is the database connection component.
IB XE7 Desktop is the database server on the development PC.
Target for the application is a VM with W7 32bit, with another IB XE7 Desktop on that VM.
I can build the 32 bit app and it will connect to the IB XE7 Desktop on the target PC (running W7 32bit in a VM) after changing the FireDac connection component protocol field to 'local' instead of TCP/IP, something I read in Stack Overflow.
What I can't get to work is the database connection in the development environment.
I first installed the 64 bit version of IB, then removed it and tried the 32 bit version with the same result.
After reading up on some connection problems online, I tried putting 'gds_db' and 'localhost/gds_db' in the server name field, but it still didn't work, although it did change the error.
Error - with nothing in the server name
[FireDAC][Phys][IB]unavailable database.
Error after putting 'gds_db' in the server name
[FireDAC][Phys][IB]Unable to complete network request to host "gds_db".
Failed to locate host machine.
The specified name was not found in the hosts file or Domain Name Services..
First tried 64 bit IB installed, then removed all gsd files found and then the Registry entries, and installed the 32bit version. Problem still persisted.
Note: Database Workbench 5 connects OK to the database on the same VM.
Any ideas welcome.
Thanks.
James F.
I remember it being quite a performance to get Delphi XE8 + Seattle working with IB XE7,
in particular I kept getting the "unavailable database" error when trying to connect from
inside the IDE. Note: the following are things I found necessary to get Delphi working with a local instance of the full IB XE7 package. Requirements for the Developer and Desktop editions very probably differ, hopefully in ways explained in their documentation.
Some of the things to check are:
Check in the Windows Services app that the server is running.
My server shows up as
Interbase XE7 Server gds_db
As you can see, the Services app should tell you the name of the server.
If you want to connect to it via TPC/IP check that you have an entry
in your \windows\system32\drivers\etc\service file like this
gds_db 3050/tcp # InterBase Server
Hash-sign developer_ibxe7 3054/tcp # InterBase Server
The line containing developer_ibxe7 should start with a #, but SO won't display that for some reason. Anyway, that line is commented out because it refers to a developer edition I installed at some point.
Check that your OS environment contains an entry like this one
INTERBASE=d:\ibxe7
If it isn't, add it and reboot the machine.
In my case, d:\ibxe7 is the top-level folder in which I have IB XE7 installed.
With those things set up/checked start a new Delphi project in the IDE, add an IBConnection to it, and set its DatabaseName to a local IB database. For me, specifying
LocalHost:D:\Delphi\Interbase\Databases\MA.GDB
works fine. Then, see if you can set the Connected property to True. If you can't,
leave a comment and I'll see what else I can remember.

FireDAC conflicts with multiple Delphi versions on the same machine

I know that generally it has always been possible to do a side-by-side installation of multiple Delphi versions on a single computer. I have often done that ever since Delphi 1.
However, after installing Delphi XE7 on a computer that had XE6 installed, I get stange errors (e.g. AV's) when trying to use FireDAC or FDExplorer from XE7. At first sight everything is OK, but when trying to connect to a database, the connection "hangs", or you get an AV.
Everything works like normal from XE6.
The installation of XE7 was done using default settings, and XE6 was installed including all updates already prior to installing XE7.
Any advice?
I did experience same problem myself when first having installed XE7 and defined some connections to Oracle and then installed Delphi XE3 in order to do some stepwise upgrades of third-party components.
Since I also needed FireDAC I installed the Firedac add-on to XE3, but when I installed the FireDAC add-on to XE3, I lost the connection definitions and when trying to define new connections I got error message that the FDconnectionDefs.Ini was not writeable in the directory (in program files(x86) Delphi/FireDAC_XE3 area.
After checking it turned out that the installer had overwritten the registrations in \HKCU\Software\Embarcadero\FireDAC key.
Turns out the same parameters in that key is reused.
So conclusion is, don't install FireDAC in elder versions, uncheck that option when installing XE4-XE6.
(I have sent a suggestion to Dmitry Arefiev that the FireDAC key should have defined new subkeys, one for each Delphi/C++ version so several installations could be used in parallell as before.
Now that is broken :-(
To clean up, find your correct FDConnectionDefs.ini and change necessary keys.
It may also be possible that the software also has been overwritten.
I did a repair on the latest version of XE7, and after some merging of FDconnectionDefs.ini files I finally got it working

open source component for postgreSQL

I would like to know if there are any open source components available for Delphi XE-2 that can connect to postgreSQL other than using outdated techniques like ODBC.
For now just Win32 support is needed, but if Win64 and OS-X support is also available that would be a bonus.
I googled around a bit, but the only lib that's available (ZEOS) looks like it is no longer in active development.
There does seem to be a patch for Delphi XE2 but I could not get it to compile.
As of right now: No.
You either route through ADO -> ODBC, dbExpress -> ODBC (for XE2*, see below), hope to make Zeos work, or pay for one of the various commercial components (PostgresDAC, DevArt, or AnyDAC, to name a few).
While Delphi XE2 comes with an ODBC driver for dbExpress, it's only for the Enterprise SKU and higher -- it's not available in Pro. For XE2 Pro users and users of older versions of Delphi there's Open dbExpress. I've tried using it before, but always had trouble with it. It's been updated since I've last used it though, so maybe whatever problems I had (which may have been my own fault) aren't an issue anymore.
All this said, ODBC isn't really an outdated technology. On non-Windows systems it seems to be the preferred DB-agnostic API. That said, it seems that many environments prefer to implement their own connectivity (e.g. QT, GNOME) rather than relying on ODBC exclusively. However, for the PostgreSQL project itself, their default (and best supported) connectivity API is ODBC.
Update: In fact, Microsoft is making ODBC their premier connectivity API for SQL Server starting with SQL Server 2002 (codenamed Denali). See: Microsoft Aligning with ODBC and Microsoft is Aligning with ODBC for Native Relational Data Access. This is the last release that will support OLE DB, and Microsoft is encouraging developers to use ODBC.
Turns out you can get ZEOS to work on Delphi XE2 and as far as I've tested all DB functionality works.
Here are the steps to follow:
Use SVN* to download the Delphi XE2 archive for ZEOS at:
https://zeoslib.svn.sourceforge.net/svnroot/zeoslib/branches/testing
Put the zeos folder in the appropriate place, I'm assuming c:\borland
Do not open Delphi yet, but instead open
C:\borland\zeos\packages\delphi16\ZComponent.dpk in wordpad and remove the trailing {$IFDEF} (remember to keep the ; in place).
Open c:\borland\zeos\packages\delphi16\ZeosDbo.groupproj.
Choose build all
Open c:\borland\zeos\packages\delphi16\build in explorer, copy all .bpl files and copy those to c:\borland\delphixe2\bin
Component -> install packages -> [add...] and choose
c:\borland\delphixe2\bin\ZComponentDesign.bpl
as a SVN client I've downloaded SVN-tortoise from: http://tortoisesvn.net/downloads.html
Combined with both the SVN plug-ins for Firefox

How, and where to install a database driver into an IDE?

I want to install a Firebird database driver, and to have it available within the Delphi XE IDE. I want the database driver to be usable on the same basis as other, supplied database drivers (eg Interbase, SQL - from within the Data Explorer in the IDE). I have obtained an appropriate driver.
The driver consists of a Delphi project, which compiles to a DLL; and modifications to two .ini configuration files (dbxconnections.ini and dbxdrivers.ini). I assume that the DLL is the actual driver, and I have compiled the project without problem.
I have got this far, and this is where I realised that I do not know what is involved in installing a new database driver; what is involved in installing a new database driver into an IDE; nor where the elements of the installation need to reside.
So my question is:
What steps are needed to install a dbExpress database driver into the Borland XE Delphi Professional IDE?
Some of the specific points I don't know about include -
Does the driver need to be registered with all of Firebase, Delphi and Windows?
Do I need to employ a specific registration procedure to accomplish registration?
Are there any elements I am missing to accomplish my aim?
Where should the installed components be located?
All four vendors, Embarcadero, Borland, UniOpen, and Firebird provide documentation (most of which is very comprehensive) but I have been unable to extract from them what I need to do and where to do it.
I have searched multiple questions on SO, but all of seem to start from the basis that the OP knows what is involved in driver installation.
All the products (except the driver project) generate multiple files in multiple locations, and it is not clear what components belong where. For example, I have multiple versions of the two configuration files residing in:
C:\Users\User\AppData....
C:\Users\Public\Public Documents...
C:\Program Files\Vendor....
....
In addition these products install files into:
the registry (multiple keys);
C:\Program Files....;
C:\Program Files (x86)....;
C:\Windows\System....;
C:\Windows\System 32.....
and probably more.
Environment:
Machine: Lenovo Thinkpad W510
OS: Windows 7 Ultimate
Delphi: Embarcadero® RAD Studio XE Version 15.0.3953.35171
Database: W1-V2.5.0.26074 Firebird 2.5
Database Driver: UniOpen Native DBX Driver
Also Installed:
Embarcado Borland® Developer Studio 2006 Enterprise Version 10.0.2288.42451 Update 2 (XP Version)
Borland Delphi Version 7 (XP Version)
In summary:
What steps and locations are needed to install a dbExpress database driver into the Borland XE Delphi Professional IDE?
You missed a file. :)
DataExplorer, from the best I can tell, uses dbxdrivers.ini. My installation of XE has a single copy of that particular file, located (Win7 64) in C:\Users\Public\Documents\RAD Studio\8.0. The connection types listed in DataExplorer come from the list of installed drivers at the beginning of that file, and each driver has one or more configuration sections which follow that list.
The driver files listed in the configuration section have to exist in a location findable (like any other Windows DLL) by LoadLibrary. The documentation in the link explains the way the API function searches for DLLs; basically though, the IDE has to find it somewhere on the PATH.
The vendor or author of your particular driver should be able to provide the info that needs to go in the dbxdrivers.ini file. (I'm not familiar with UniOpen personally, and don't have FireBird on this particular machine.) The IDE only reads that file during startup, so you'll need to (re)start the IDE after making the additions.
This post at the Embarcadero Delphi Database->DBExpress forum may help with defining aliases for your Firebird databases, and describes connecting via the TSQLConnection component. (Look for a post by Ralph Horbury-Smith.) If you don't have a Developer's Network ID, you'll need to register with the Embarcadero site; the link I provided uses HTTPS for some reason. You can also get to their forums via NNTP; I'm not using a newsreader, so I'm not sure what the address would be. There's a link to connection info on this page at Embarcadero.
There's also some information available on the Delphi XE documentation Wiki pages that might help as well.
EDIT: Found one more link at the DBExpress forums that might interest you. It has a link for another FB DBExpress driver and specific information for the dbxdrivers.ini file for that driver. It's the post by Phillip Flores (about the 3rd one down on the page).
I am accepting #Ken's answer. His response provided links to various resources. I am summarising the answers to the specific points I had that I have obtained from the references.
There is no need to amend dbxconnections.ini - the IDE will do that for me.
I need to amend dbxdrivers.ini appropriately and place it in the IDE directories.
The actual driver needs to be somewhere on the path - typically System32.
There is no need to register the driver with Windows.
Apart from the items listed above, there is no special procedure needed to register such drivers.
The list here appears complete.
EDIT:
My conclusions in this summary were premature and I have asked a further question to try and obtain further information. The strikeout in the list above marks the incorrect elements.

How, and where to install a database driver into an IDE? Part II

The background to this query was this question.
I have installed this driver for Firebird and placed it within the path (system32) used by the IDE. The XE Data Explorer recognises the driver, and it is possible to create a connection using the Data Explorer. Trying to view tables or any other database element through this connection results in the error described in this question. As far as I can see #Alejandro Jourdan has not obtained a solution to this problem, and I can find no solution on any of the support sites for Firebird or for Delphi XE.
The second problem comes when I create a TSQLConnection using this connection. The connection works to the extent that it generates the login prompt to the database, but when it tries to open the connection I get the error message: 'file is not a valid database' This error message is (sort of) reproducible from within the Data Explorer which gives the following error:
I/O error during "CreateFile(open)" operation for file [database path] Error while trying to open file. Access is denied..
The database is valid and can be opened from the Firebird command line utility, and from a Data Base browser.
Environment:
Machine: Lenovo Thinkpad W510
OS: Windows 7 Ultimate 64bit
Delphi: Embarcadero® RAD Studio XE Professional Version 15.0.3953.35171
Database: W1-V2.5.0.26074 Firebird 2.5 (64 bit)
Also Installed:
Embarcado Borland® Developer Studio 2006 Enterprise Version 10.0.2288.42451 Update 2 (XP Version)
Borland Delphi Version 7 (XP Version)
EDIT:
See my own answer below. This edit has removed extensive detail that proves to be unnecessary in the light of that answer, while retaining the core of the question, and the links contained within it.
The first thing that sticks out to me is that you're using the 64-bit version of Firebird, and that you mentioned it comes with both a 32- and 64-bit driver. Are the DLLs named the same? If so, I suspect that the IDE/OS are trying to load the 64-bit version of the DLL in a 32-bit application, which isn't possible (32-bit apps can't load 64-bit drivers, and vice versa).
Try one of two things:
First, if the DLLs have the same name, rename the 64-bit version temporarily, and restart the IDE. Then try again.
Try installing the 32-bit version of Firebird, even though you're running a 64-bit OS.
The basic question I had (in part I) was:
I want to install a Firebird database
driver, and to have it available
within the Delphi XE IDE. I want the
database driver to be usable on the
same basis as other, supplied database
drivers (eg Interbase, SQL - from
within the Data Explorer in the IDE).
I have obtained an appropriate driver.
After considerable investigation I have found that it is not possible to achieve the integration into the Delphi IDE that I was trying to achieve. This is because the Data Explorer is a .NET application and the available DBExpress drivers (here and here) are just not compatible with .NET. I understand that I can use the drivers by setting up the parameters appropriately, in both the IDE and by programming in the application I am developing.
I have drafted this answer to assist others to avoid this particular blind alley. I am also editing the part II question in order to remove a lot of the detail, that proves to be unnecessary in the light of this answer.

Resources