Delphi/WebServers - Interbase Component (IBX) Issues

There are various issues using Firebird databases in a webserver. This page covers problems traced back to the Interbase Components (IBX).

As far as I know, all of the issues on this page are related to code compiled with Delphi 5 and run on Windows XP.

When the "identical" code is compiled with Delphi 6, the exe's work on BOTH Windows XP and Windows 2000.

Overview | IIS | Opening source code in Delphi | IB Components | Koders Notes
Windows 2000 Failure | Debugging at a Command Prompt | Borland Delphi 5 Update | Specifying the Database


I have an exe webserver that was compiled with Delphi 6. It works properly with Windows 2000. I copied the exe to a Windows XP system and it also works fine.

When I compile the same program with Delphi 5, it fails with this error.

IIS "shared resource" failure

I wrote a very simple program that simply connects to a database and displays a single string (that's all). This is the error.

It works perfectly in a command prompt.

It also works if the Delphi 5 IDE is closed!

Delphi 5 "shared resource" failure

I compiled one of the servers as a dll ... it produces the exact same errors as the exe file. However, when I reopened the web module source in Delphi 5, this error was produced.

When I reset IIS, the web module could be reopened without an error.

Give me a break, IIS is crashing Delphi.

This is acting like a problem introduced when Microsoft updates an operating system and breaks code created with competitor's compilers. (I've had that problem before - I refuse to blame Borland for this type of problem.)

Related Research

Since these servers run under IIS, I don't know how to single step the code. However, some searches indicate that this error appears to be related to TIBSQLMonitorHook.Create. Of course, I don't have one of these in the application ... therefore, I assumed (incorrectly) that it was NOT related to the problem.

I searched the Delphi source for

and found only one file containing Searching for SCannotCreateSharedResource yields only an array of strings. Searching for found Only one other file contained this variable (ibxeCannotCreateSharedResource) which contains several instances of in TIBSQLMonitorHook.Create which, in turn, is called by the MonitorHook function which is called from both ibdatabase.pas and ibsql.pas. Specifically, explicitly use MonitorHook.

Additional testing proves that calling MonitorHook causes the problem. Specifically, this line causes the problem

and produces this error

This code is completely rewritten in later Delphi versions.

Interbase Components

These problems appear to be due to the Interbase Components. I have a major complaint with these As a result, the only version indicator is the file date (amateurs do a better job) except that the Koders files don't even have that.

Actually, one of the files, the Koders 2001 version of IBXConst.pas, contains 2 different version numbers. (Maybe I'm missing something.)

This table compares several versions of the Interbase Components.

Koders provides a free Delphi IB component set ... but no register routines. (These don't appear to be needed.) You need to download 17 (of 24) files before you can compile anything - that's right, they have to be downloaded one at a time ... there is no zip file and there are no instructions (give me a break). (I downloaded and zipped the 34 Koders ibx files available on 06-19-06 - - I don't remember how to install it.)

This table shows which files are available in which versions (sizes are for the *.pas files).

Notes on the Koders data

I would have never solved the Delphi 5 ibx problem without the Koders data ... but what a lousy site - it contains at least 3 different versions of the ibx components but no useful way to know which one you are accessing.

The only obvious way to tell the versions apart are the copyright notices

and the license url (by the way, neither url works) A google search got me to one of the sites, a search on Koders (for ibx) got me to the others ... but it was all just luck.

After some digging, I eventually found the register code for the property editors in a slightly different location. (Click the icon above the list of files, then click the plus sign, and select design.) I never found a useful index page. (This is a really bad site with some very good data.)

They claim that the project is available on SourceForge ... but there are no available files.

Using the Koders Files

The only method I know to install the Koders files is to delete the existing *.pas and *.dcu files and then place the new *.pas files somewhere in the path. Then the *.dcu files will be automatically recompiled when needed. The main problem with this is that all the icons will be lost (because there are no resource files).

However, the first time that I installed these, I did not loose the icons ... but I've lost my notes on how I did that.

Hint: Don't actually delete anything - instead, move them to another directory so that you can recover if necessary.

Windows 2000 Failure

I eventually had the same general cannot create shared resource error running an *.exe under Windows 2000.

This code worked several weeks before it finally failed. However, another version of the *.exe (that performs the same function) worked.

Restarting Firebird had no effect. When I tried to restart IIS, dllhost.dll had the same error. However, restarting IIS "fixed" the problem - now both versions of the *.exe work on Windows 2000.

This pretty much proves that IIS (a Microsoft program) is causing a Delphi program to fail.

Note: I'm not really sure which version of the *.exe was failing because I compile on multiple machines and copy the *.exe's to the needed directories. But I am sure that one version worked and another failed until I restarted IIS - then both versions worked.

Debugging at a Command Prompt

Some simple web server problems can be analyzed by running the program at a command prompt. However, the design problems listed on this page could not be fixed that way.

Borland Delphi 5 Update

Apparently, in 2002 Borland posted an IBX fix (that I missed) ... if you can find it.

However, before you can use this fix, you will need to load Delphi 5 SP1 (26 MB) ... it only took about 2 hours to find THAT. (Hint - On Delphi Developer Support, click the Delphi Downloads link above Delphi 5 Corba update now available - hey, it was not obvious to me. I thought that the link applied only to Corba updates. Therefore, I kept clicking on the Delphi 5 Update fixes and Delphi 5 fixes and known issues links - silly me.)

Funny that the IBX fix is a "private" update ... not on the official Borland downloads page.

Notes: You will need your Serial Number and Authorization Key to install SP1
The IBX updates are ok ... and they DO fix the problem

Most of the new IBX pas and dcu files are dated 10-07-02 or 10-08-02 and contain the following comment (but still no revision info)

(IBDatabaseINI.pas was also modified by John Kaster.)

Specifying the Database

Be careful on how you specify a database name

Author: Robert Clemenzi -
URL: http:// / user / clemenzi / technical / Databases / Delphi / WebServers / Webserver_IB_Component_Issues.html