Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Borland Database Engine (Error $2108)

Posted on 2002-03-28
9
60,886 Views
Last Modified: 2009-10-19
In my Delphi 3 application, I have TDBGrid, TDatabase and TDataSource components.  When I compile the project to an EXE, and then give the EXE to a friend to use on their own PC, they get the following error when they launch the program:

An error occured while attempting to initialize the Borland Database Engine (Error $2108)

I realize that the problem is that the BDE engine is not installed on my friend's PC.  That's not really a big problem, since the table/database is not the main focus of the program, and only serves a minor function.  He won't miss much if the table is not available.

However, it is a bit annoying for him that this error appears every time he launches the program.

My question...  How can I prevent (exception trap) this error message so that the error message does not appear?  And 'no', I don't want an Expert to reply, "Install the BDE engine!"

Assuming I don't install the BDE engine for my friend, how can I prevent the error from appearing?  Is there any way to keep the error from appearing withOUT installing BDE on his PC?

If so, how?

Thanks.
0
Comment
Question by:Kapusta
9 Comments
 
LVL 1

Expert Comment

by:Alone
ID: 6904493
There are three ways to install BDE:
  - using Delphi disk
  - making own install pack
  - from command line ;-)

I thing third way is simplest. Try to extract bdeinst.dll from bdeinst.cab in your BDE directory by typing following command:

  extract <YourDrive:\YourPath>bdeinst.cab bdeinst.dll

If your friend has Windows NT (2000, XP) use expand command instead of extract.

After extracting, start BDE installation:

  regsvr32 bdeinst.dll

and follow the screen instructions.

This BDE redistributable pack install only local drivers. If you are using SQL links you must install required drivers manually or use other way to install BDE
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6904623
?
i've a car, there is no engine in,
how to get the car drive without installing the engine?

its not really the main problem,
because i want only to hear the sound.

(just impossible)

you've to install the bde

meikl ;-)
0
 

Author Comment

by:Kapusta
ID: 6904944
>> And 'no', I don't want an Expert to reply, "Install the BDE engine!"  <<

I don't know how much clearer I could have made it...
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:JDN
ID: 6905627
Kapusta,

Your program can of course run on a pc without the BDE installed, but only if no database component will be accessed or initialized.
You can trap any BDE error with a TRY...EXCEPT, but you need to know exactly where the error is raised. Therefore the best thing you can do is to launch the program yourself in your compiler, but without BDE. You can temporary rename the \Program Files\Common Files\Borland Shared\BDE folder (assuming your BDE is installed there). Now you can simulate and locate the error your friend is seeing when the program is lauched, and program some traps there.

Hope this will help.
JDN
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6906085
Does not seem to be any need for the TDBGrid, TDatabase and TDataSource components if you are not going to install the BDE. Why not just remove the components.

Chances are the TDatabase component is generating the error.


The Crazy One
0
 

Author Comment

by:Kapusta
ID: 6906119
>> Does not seem to be any need for the TDBGrid, TDatabase and TDataSource components if you are not going
to install the BDE. <<

I never said that there was no need for the components.  My friend is not the only one running the app.  I am using the app on my PC, which has the BDE.  I use the table.  My friend has no need for the table.  I have no desire to write 2 versions of the program.  Therefore all I want to do is suppress the error message for those users with BDE installed.
0
 

Author Comment

by:Kapusta
ID: 6906122
>> for those users with BDE installed. <<

Typo correction:

for those users withOUT BDE installed.
0
 

Author Comment

by:Kapusta
ID: 6906141
>> You can trap any BDE error with a TRY...EXCEPT, but you need to know exactly where the error is raised.
Therefore the best thing you can do is to launch the program yourself in your compiler, but without
BDE. You can temporary rename the \Program Files\Common Files\Borland Shared\BDE folder <<


I have renamed the BDE folder as per your suggestion.  I then ran the code in the IDE.  The error occurs on the Table1.Open line.  Adding Try/Except, however, does not suppress the error window.  When compiled to EXE, the same error message window appears.

Here's the current code...

     Database1.Open;
     try
          Table1.Open;
     except
          // BDE engine not installed
                // Error window appears
     end;
0
 
LVL 44

Accepted Solution

by:
CrazyOne earned 50 total points
ID: 6906185
Ok then look for this registry setting

HKEY_LOCAL_MACHINE\SOFTWARE\Borland\Database Engine

DLLPATH

If the key doesn't exist then the BDE is not insatalled. If the Key does exist then check that the path exits that the above key is pointing to. Then see if the file idapi32.dll exists. If a false is returned on any one of these checks then in your code set it up to not use the components in question. In other words don't open the table or call on the TDatabase or TDBGrid component.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi XE10, MySQL Query 4 164
FMX enumerated colours 2 115
Delphi: how to implement a User Shortcut mapper? 1 117
can't find the executable in Simulator 1 100
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

765 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