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
When I compile the same program with Delphi 5, it fails with this error.
Internal Server Error 500 -------------------------------------------------------------------------------- Exception: EAccessViolation Message: Access violation at address 004987D3 in module 'Sphere_Status_aa.exe'. Read of address 0000006C
I wrote a very simple program that simply connects to a database and displays a single string (that's all). This is the error.
Internal Server Error 500 -------------------------------------------------------------------------------- Exception: EIBClientError Message: Cannot create shared resource. (Windows error 5)
It works perfectly in a command prompt.
It also works if the Delphi 5 IDE is closed!
Delphi 5 "shared resource" failure
--------------------------- Application Error --------------------------- Exception EIBClientError in module VCLIB50.bpl at 0000384C. Cannot create shared resource. (Windows error 5).
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.)
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
Cannot create shared resourceand found only one file
C:\Program Files\Borland\Delphi5\Source\Vcl\ib.pascontaining
SCannotCreateSharedResource = 'Cannot create shared resource. (Windows error %d)';Searching for SCannotCreateSharedResource yields only an array of strings. Searching for
SharedResourcefound
ibxeCannotCreateSharedResource - an index into the array that has the stringsOnly one other file contained this variable (ibxeCannotCreateSharedResource)
C:\Program Files\Borland\Delphi5\Source\Vcl\ibsqlmonitor.paswhich contains several instances of
IBError(ibxeCannotCreateSharedResource, [GetLastError]);in TIBSQLMonitorHook.Create which, in turn, is called by the MonitorHook function which is called from both ibdatabase.pas and ibsql.pas. Specifically,
Additional testing proves that calling MonitorHook causes the problem. Specifically, this line causes the problem
FWriteLock := CreateMutex(nil, False, PChar('IB.SQL.MONITOR.Mutex'));
and produces this error
SysErrorMessage(5) -> Access is denied
This code is completely rewritten in later Delphi versions.
Interbase Components
Actually, one of the files, the Koders 2001 version of IBXConst.pas, contains 2 different version numbers. (Maybe I'm missing something.)
IBX_Version = 4.62; SInterbaseExpressVersion = 'InterbaseExpress 4.3';
This table compares several versions of the Interbase Components.
Delphi 5 | Delphi 5 IBX 5.04 | Delphi 6 | Koders 2001 | Delphi 2006 | |
---|---|---|---|---|---|
Number of unit files | 18 | 30 | 19 | 24 | 34 |
Number of Editors | 0 | 12 | 4 | 0 | 21 |
Version | Not Available | Not Available | Not Available | 4.3 or 4.62 | Not Available |
IB.pas | 08/11/1999 05:00a | 10/07/2002 12:38p | 05/22/2001 02:00a | Not knowable | 11/14/2005 2:00pp |
IBSQLMonitor.pas | 08/11/1999 05:00a | 10/07/2002 12:50p | 02/15/2002 03:02p | Not knowable | 11/14/2005 2:00pp |
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 - Koders_ibx_2001.zip - I don't remember how to install it.)
This table shows which files are available in which versions (sizes are for the *.pas files).
File | Delphi 5 | Delphi 5 IBX 5.04 | Delphi 6 | Koders
2001 2000 | |
---|---|---|---|---|---|
IB.pas | 20 K | 14 K | 15 K | 15 K | 15 K |
IBBatchMove.pas | dcu only | 8 K | - | 9 K | 9 K |
IBBlob.pas | 12 K | 13 K | 13 K | 14 K | 13 K |
ibconst.pas | In Samples | - | - | - | - |
ibctrls.pas | In Samples | - | - | - | - |
IBConnectionBroker.pas | - | 11 K | - | - | - |
IBCustomDataSet.pas | 103 K | 117 K | 118 K | 119 K | 111 K |
IBDataBase.pas | 55 K | 64 K | 68 K | 66 K | 56 K |
IBDatabaseInfo.pas | 16 K | 16 K | 17 K | 17 K | 17 K |
IBDatabaseINI.pas | - | 10 K | - | - | - |
IBDCLConst.pas | - | - | 1 K | - | - |
IBDialogs.pas | - | 3 K | - | 3 K | 3 K |
IBErrorCodes.pas | 33 K | 34 K | 35 K | 35 K | 35 K |
IBEvents.pas | 10 K | 15 K | 16 K | 17 K | 12 K |
IBExternals.pas | 5 K | 6 K | 6 K | 7 K | 7 K |
IBExtract.pas | - | 126 K | 129 K | 130 K | 108 K |
IBFilterDialog.pas | - | 34 K | - | - | - |
IBFilterSummary.pas | - | 2 K | - | - | - |
IBHeader.pas | 128 K | 132 K | 140 K | 137 K | 134 K |
IBInstall.pas | dcu only | 24 K | - | 26 K | 25 K |
IBInstallHeader.pas | dcu only | 12 K | - | 13 K | 13 K |
IBIntf.pas | 23 K | 26 K | 30 K | 26 K | 25 K |
IBQuery.pas | 12 K | 13 K | 13 K | 14 K | 14 K |
IBScript.pas | - | 31 K | - | - | - |
IBServices.pas | dcu only | 64 K | - | 64 K | 64 K |
IBSQL.pas | 64 K | 77 K | 76 K | 75 K | 71 K |
IBSQLMonitor.pas | 20 K | 31 K | 32 K | 33 K | 31 K |
IBStoredProc.pas | 15 K | 16 K | 17 K | 17 K | 16 K |
IBTable.pas | 49 K | 55 K | 57 K | 58 K | 51 K |
IBUpdateSQL.pas | 6 K | 6 K | 7 K | 8 K | 7 K |
IBUtils.pas | 4 K | 5 K | 7 K | 6 K | 6 K |
IBXConst.pas | - | 10 K | 11 K | 11 K | 10 K |
IBXMLHeader.pas | - | 8 K | - | - | - |
IBGeneratorEditor.pas/frm | - | x | x | - | - |
IBRestoreEditor.pas/frm | - | x | x | - | - |
IBSecurityEditor.pas/frm | - | x | x | - | - |
IBServiceEditor.pas/frm | - | x | x | - | - |
Notes on the Koders data
The only obvious way to tell the versions apart are the copyright notices
{ Copyright (c) 1998-1999 Inprise Corporation } { Copyright (c) 1998-2000 Inprise Corporation } { Copyright (c) 1998-2001 Borland Software Corporation }and the license url (by the way, neither url works)
1999 - no license url 2000 - License at http://www.Inprise.com/IPL.html 2001 - License at http://www.borland.com/interbase/IPL.htmlA 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
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
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
Borland Delphi 5 Update
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)
Additional code created by Jeff Overcash and used with permission.(IBDatabaseINI.pas was also modified by John Kaster.)
Specifying the Database