Solved

InterBase component causes crash in Delphi app.

Posted on 2010-09-04
11
1,035 Views
Last Modified: 2013-12-09
I'm trying to trace the cause of a problem in an application I'm building using Delphi 2010 and InterBase 2009.

If I include an IBDatabase component on a form, the app will run on my development PC. However, if I try to run the executable on the 32-bit Windows XP Pro target machine, it crashes with the "Project1.exe has encountered a problem and needs to close.  We are sorry for the inconvenience" message.

In attempting to diagnose the problem, I created an app containing an empty form, and another app with a form with a few, non-database components on it. They both run on the target machine without a problem.

Then I dropped a component of type TIBDatabase on the empty form, leaving its properties as the defaults.  The app runs in the IDE, and runs as a stand-alone executable on my development PC.  However, if I try to run it on the target PC, I get the usual crash.

I have just re-installed InterBase 2009 Server edition, with one user, on the target PC, and have verified that I can access the database on it using IBConsole.  I suspect that the problem may be related to the setup/configuration of InterBase on the target PC, but I'm at a loss as to what to look for next.

It would appear that the mere presence of an InterBase component on a form will cause the app to crash on the target machine.

The real sickener is that I have had the database application running on this target PC, but an unrelated problem meant that the machine was wiped and the OS reinstalled recently, since when I've been having this problem.

Please help!

Thanks,

Peter
0
Comment
Question by:peterhindle
  • 6
  • 5
11 Comments
 
LVL 4

Expert Comment

by:bjove
ID: 33603180
What protocol do you use in TIBDatabase component?
0
 

Author Comment

by:peterhindle
ID: 33603232
I'm not sure that I understand the question.  The IBDatabase component is left with the default values, but of course the component itself doesn't have a 'protocol' property.  The communication between the InterBase server and the client (the app that crashes) is local--i.e. not TCP/IP nor NetBEUI.

Have I answered your question satisfactorily?

Peter
0
 
LVL 4

Expert Comment

by:bjove
ID: 33603307
You don't even try to open the database in code and AV is generated?
You can try to create the TIBDatabase object in code, so you can trace the creation of the Database object and see what causes the AV. Add IBDatabase.pas unit in your project (on my PC path is "'c:\program files (x86)\embarcadero\rad studio\7.0\SOURCE\WIN32\IBX\IBDatabase.pas').  Configure remote debugger on target machine (http://delphi.wikia.com/wiki/Remote_Debugger). The guide is for d2007/2009, but it is same for d2010. Then try to trace the code in the constructor of the TIBDatabase. Hope this helps.
0
 
LVL 4

Expert Comment

by:bjove
ID: 33603435

You can also use this code to check if interbase client is installed correctly and can be loaded. (http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/IBIntf_CheckIBLoaded.html)
You have to add IBIntf in uses clause.
procedure TForm1.Button1Click(Sender: TObject);

begin

  try

    IBIntf.GetGDSLibrary.CheckIBLoaded;

    ShowMessage('IB is installed');

  except

    ShowMessage('IB is not installed');

  end;

end;

Open in new window

0
 

Author Comment

by:peterhindle
ID: 33603585
Thanks very much for your responses.

I tried checking to see if the IB client is loaded, by putting the code in the form's CreateForm method, but unfortunately the program crashes before it gets that far.

I'm now going to try the other idea you suggested, and create the TIBDatabase object in code. I'll let you know how I get on.

Thanks again,

Peter
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Accepted Solution

by:
bjove earned 500 total points
ID: 33603604
Use form without TIBDatabase component for checking if IB client is installed.
0
 

Author Comment

by:peterhindle
ID: 33603634
Oh! How stupid of me. Sorry!

I follwoed your excellent suggestion, and the program reports that IB is *not* installed. So that seems to be the problem, now have you any idea how I fix it, please?

0
 

Author Comment

by:peterhindle
ID: 33603693
Some further information: I've checked to see if GDS32.dll is present on the target machine, and it is, in C:\CodeGear\InterBase\Bin. Does it need to be in the %System32% folder?

Post script: I've copied GDS32.dll and Interbase.msg to the folder containing the executable, and the test program now reports that IB is installed.  Looks promising, and I'll have a go with the full program now.  Will report a little later.
0
 

Author Comment

by:peterhindle
ID: 33603700
Yep - app now runs as it should.  Very many thanks for your help.

Peter
0
 
LVL 4

Expert Comment

by:bjove
ID: 33603704
Try to copy gds32.dll from your development PC to target PC in system32 folder.
0
 

Author Comment

by:peterhindle
ID: 33603770
Hmm... once I knew that the problem was related to gds32.dll, I discovered that this is a known bug.  It's documented here (with a workaround):

http://support.codegear.com/article/40247

Of course, as I had no indication that the problem was caused by a missing gds32.dll, I wasn't able to find the article which would have solved the problem.

I hope that this helps others in future.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now