BDE (a database engine through which you can connect to different databases)

Source: Internet
Author: User
Tags aliases dbase ole

BDE (Borland) is the database engine of inprise company,
It combines SQL links to allow programmers to connect to a variety of different databases through it.
BDE is the abbreviation for the Borland Database Engine, which is used to drive the database, just like ODBC.
The same dBASE table can be driven by BDE or by ODBC.

Brief introduction

To develop a database application first to solve the problem of the data source, then what is the data source?
Simply put, the data source is real data, usually a variety of data tables.
With the data source we have the basis for the development process, however, in general, the application does not directly interact with the data source,
You must pass some mediations, which are called database drives, and typically have at least one database drive per database.
such as: Access,foxpro,dbase and other databases have their own database drives, with these database drives, for the sake of programming convenience, then generated the management of these database drive engine,
With the database engine, programmers don't bother to access different database drivers when they're programming.
As long as you access the database engine in a uniform way, and let the database engine complete the conversion of different database drives,
The database engine is like a public interface, providing a unified approach to accessing the database.
BDE is the abbreviation for the Baolan data Engine (Borland database), which not only accesses different local databases,
Applications can also be uploaded locally to the client-server system and are highly efficient.

Categories of data that can be accessed:
One, local data.
Second, the client-server system of offsite data.

Working principle

BDE is the hub part of Delphi database function, all database accesses use the routine which needs to be handled by BDE, so BDE is the bridge connecting application and database. It is composed of several DLL modules, each module is responsible for dealing with some database related work.
If other versions or duplicate BDE are installed on the machine, then BDE is loaded into the BDE DLL file (Idapi32. dll) in the following search order and the BDE is initialized:
1) Search the current directory (the current directory is not necessarily the same as the application's startup directory); If the file is not found, it will continue;
2) Search the registry hkey-local-machine \ software\ Borland \ Database Engine \ dllpath \ xxxxx The corresponding project, if the file is not found, will continue;
3) Search According to the order of the Loading library files: The path that is set in the current startup directory of the application →system directory →windows directory →path environment parameters.
Load the driver DLL file in order, except for the first step of the search path to Idapi32.dll This file is loaded in the directory, the other basically the same as above. and BDE reserved Some preferred memory addresses for some DLL files,
If the corresponding Bdedll file cannot be loaded into those specific preferred memory addresses, the system will make an error message and cause the initialization to fail.
BDE is a process-based database access interface through which database aliases (DatabaseAlias) can be established.
Enables Delphi to access various data tables in the database alias.
BDE plays an important role in Delphi.
If the Delphi application submits a request to the database, the request must be submitted to the database management system via BDE,
The database management system responds to requests from the application and transmits the query results via BDE to the Delphi application.
For a local database that is used only on a single machine, Delphi controls the reading and writing of data in the database via BDE.
For the backend remote database system.
BDE still needs to be Sqllinks or ODBC (Open database connectivitydrivers) to read the contents of the database.


different from ADO
Introduction to ADO
Unlike BDE, ADO is the next-generation data access specification that Microsoft has introduced, and in Delphi6 it is equivalent to a data engine that is tied to BDE.
ADO is actually closely related to ActiveX technology, and ActiveX is closely related to technology such as ole,com.
Although ADO has a weaker function than BDE, ADO has some important advantages over BDE,
Like what:
ADO will be built into all of Microsoft's new operating systems starting from Windows2000,
This alone is enough to draw a question mark on other data access methods.
The full support for ADO is provided in Delphi7, which provides a lot of ADO components,
A number of new field types such as Widestring,guid,variant,interface,idispatch are also added.
ADO is a high-level interface for a variety of data, it provides powerful data access capabilities, and the data objects that can be accessed are:
1> the various data in the relational database;
2> non-relational database, such as hierarchical database, mesh database, etc.;
3> e-mail and file system;
4> text with images, sounds;
5> the client transaction object.

First, using the BDE data engine to achieve database connectivity
The BDE connection database has the following steps:
1) Create an alias for the database. The core of BDE usage is the use of BDE aliases.
The alias is the logical name of the database, which implies that the database stores the physical address and the network database connection.
In order for an application to establish a connection through an alias and a database, first create an alias for the database in Bdeadministrator.
2) Configure the relevant parameters.
Description: Host name is the name of your own host, I am here Lisan, server name is the name of SQL Server, I am lisan\lisan here, DataBaseName is the name of the database you established under SQL Server, UserName The name is SA and the corresponding dialog box will appear to enter the password. This is the user name and password that you use to connect to the database later. After the database is connected, the fonts for those attributes automatically become bold. After the database is connected, the subsequent operation is no longer connected, just enter the correct user name and password to successfully connect. After that, you only need to connect to individual tables with individual cases.
3) Select the data Access component.
Database components are primarily data access components and data Control components. Add data Access Components ttable, Tquery, tdatasource to access the database on the data modules form, and set the properties of each component.
4) Select the Data Control component. Add components such as Data Control Components DBGrid, Tdbedit, and so on on the form, and set the properties. Sets the component DBGrid, Tdbedit. This component is generally only set to the DataSource property, and is used to establish a contact with the component DataSource, which is set to Data-source1. Obviously, component DataSource is used to establish a connection between components Table1 and DBGrid, that is, to establish a data channel in order to simplify programming. With the above four steps, you can complete the database connection.

Second, using ADO technology to realize database connection
The native ADO object and the ADO Express component can be used in Delphi applications to connect to a SQL Server 2000 database.
With my graduation project "design and implementation of sales management information system for small apparel companies", this article introduces the ADO Express component to connect to the SQL Server 2000 database. There is an ConnectionString property for the ADO component in Delphi other than the connection type.
You must first configure this property to connect to a SQL Server 2000 server.
The ConnectionString property of multiple ADO components connected to the Sales management system database is the same, so you can configure only one ConnectionString property and share the same connection by configuring the ConnectionString properties of other ADO components. This increases the efficiency of access to SQL Server 2000. The Sales Management system database is stored on a server named Lisan\lian, whose database name is LV, the login user is Lisan, and the login password is Lisan. Here's how:
String:= ' Provider=SQLOLEDB.1;
Persist securityinfo=true;
User Id=lisan;
Data Source=lisan\lian '
ADOConnection1 is an object of the ADO Connection Class (component). Where provider= sqlole db.1 indicates that the OLE DB provider, user Id=lisan and Password=lisan indicate the username and password to log into SQL Server, persistsecurity Info =true make the connection group Automatically stores the user login password, Initial CATALOG=LV indicates the name of the Sales Management System database (alias), Datasource=lisan\lian indicates the server name where the database resides.
Alternatively, you can use the Connect Wizard to make the connection, double-click the ADOConnection1 object as shown in the Connection wizard. There are two ways this connection wizard can connect:
1) Select Usedata Link File and use the browse button to
Connect a file with an external suffix of UDL (this file can be implemented by creating a new empty text file and then changing the suffix, and then you can open the file to set the external connection properties) so that the information for the adoconnection1.connection String is stored externally. The disadvantage of this connection is that the UDL file is not encrypted, and if you save the password, you can see the password through WordPad.
2) Select Useconnection String and click the Build button to pop up the dialog box.
Enter the information for the adoconnection1.connection String here to connect to the database. You can then access the Sales Management System data table through the Tadoquery component, set the Connection property of the Tadoquery class object ADOQuery1 to ADOConnection1, and then specify the operation by setting its SQL property. For example, to return the basic clothing information from the database:
adoquery1.sql:= ' Select*from clothing basic information table ';
Users can also specify additional SQL descriptions for the SQL properties of the Tadoquery class, enabling filtering of complex data queries.

Component Introduction

Briefly describe the database components commonly used in Delphi.
1. Data Access Components (Component)
The data access component can be found on the Metadata Access Component page of the Delphi Palette. Here we should note: Table, query, and StoredProc three controls, which are called "DataSet Components",
Used to connect to the database. Learners can think of these controls as "virtual" databases, and actions on them can be thought of as operations on the database. (1) The DataSource control is the connection medium for the data set component and the Data Control component. The Data Control component is the interface of the user to manipulate the data in the database.
The data can be displayed, modified, maintained, and so on, only through the DataSource control to be connected to the DataSet component. (2) The table control accesses data in the database through the database engine--bde.
The user's actions on the database (such as additions, deletions, modifications, etc.) are passed to the database via BDE.
(3) The query control uses the SQL (structured query Language, Structured Query language) to operate the database via BDE,
Similar to what the table control does, it is implemented using SQL only. (4) The StoredProc control is a database application that operates on the server database via BDE and is commonly used in the client/server (c/s) structure. (5) Database control is typically used to establish a connection between a remote database server-a client/server structure, and database applications and databases. (6) Session control is used to control database applications and database connections, mainly for the implementation of complex functions, such as: Multi-threaded database programming.
2. Data Control component (Component)
Data Control components can also be referred to as data display components or data browsing components. Their main function is to work with data access components, providing users with an interface for browsing and editing data. The Data control component is on the DataControl page on the component board. They are mainly: DBGrid controls, Dbnavigator controls, dbtext controls, Dbedit controls, Dbmemo controls, Dbimage controls, Dblistbox controls, Dbcombobox controls, Dbcheckbox controls, Dbradiogroup controls, Dblookuplistbox controls, Dblookupcombobox controls, Dbrichedit controls, Dbctrlgrid controls, Dbchart controls, and so on. In addition, there are some components related to the database. For example, the decision cube is a set of controls that are primarily used for statistical work, expressing statistical results in a straightforward way, such as tables or graphs. Qreport is the control used to output the report, but, empirically, this control is less suited to Chinese reporting habits. This component was purchased by Borland Company and performance is not very good, so not many use. Some third-party controls provide report controls that work well, and some people make their own report controls that are well suited to Chinese habits. Another component page is ADO (ActiveX data Objects), which uses Microsoft's OLE DB functionality to access and manipulate data in the database server. The main advantages are ease of use, high speed, low memory payments, and less storage space. ADO supports the establishment of client/server and Web-based applications. ADO also has Remote Data Services (RDS) capabilities that enable RDS to move data from the server to a client application or Web page, process the data on the client, and then return the results back to the server in a single round trip. ADO is becoming popular, ADO itself is very complex, Microsoft has a special help file to explain how to use ADO, learners are interested in finding relevant information to further study.

Software Benefits

Two ways to connect databases in Delphi: BDE Data Engine and ADO technology. In comparison, the BDE data engine has the following four advantages: 1) Its applications run very efficiently.
2) currently BDE is the best integrated database access engine with Delphi, which supports the corresponding database access capabilities by providing the appropriate driver installation, so Delphi database applications can access multiple types of databases rather than a single database. Thus Delphi has a strong ability to write distributed database applications, and for some databases it can only be accessed using the BDE engine.
3) BDE supports database programming in a way that provides components, and programming is straightforward and straightforward.
4) BDE is very convenient for configuration management during installation of database applications, especially in network environments.

Although BDE has a lot of advantages, but Borland company to BDE has entered the stage of maintenance, stopped the update of BDE development. On the contrary, ADO has a broad prospects for development, although the implementation of ADO may be somewhat inferior to BDE, but ADO not only has the post three advantage of BDE, it is also a universal database access technology, and has been widely supported, the use of a wide range, upgrade and maintenance more convenient.

Note: The contents of the essay are from the online data collation, for reference only.

BDE (a database engine through which you can connect to different databases)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.