Current location - Education and Training Encyclopedia - Education and training - DELPHI Basic Course: Delphi Client Server Application Development (3) [1]
DELPHI Basic Course: Delphi Client Server Application Development (3) [1]
Installed software project

When you install the InterBase SQL Link driver, the following items will be installed on your workstation.

File name of table installation

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Articles? describe

──────────────────────────────────────

The SQLD IB DLL contains the InterBase driver and the dynamic link library SQLINT DLL supporting files.

INTRBASE driver type? Add to the driver manager of the configuration tool to configure the basic BorlandInterBase SQL link driver.

INTRBASE alias type? Add an alias for the configuration file, so that you can establish an alias to connect to the SQL server database.

Configure SQLD_IB HLP help file for InterBase driver.

Readlink txt borland SQL link of windows readme file

The INTERBAS MSG InterBase message file is usually installed with C:\INTERBAS.

CONNECT EXE tool is used to test the connection between workstation and InterBase server, and the remote DLL InterBase supports dynamic link library.

GDS DLL GDS DLL will describe the installation process of InterBase server, modify the service files of workstations and add the added service files? Description of protocols required for InterBase server access, such as gds db /tcp.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Software projects should also include TCP/IP interface software.

The files listed in the following table provide an interface for InterBase client applications to access Winsock.

Table TCP/IP interface software

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Description of the document name

────────────────────────────────

MVWASYNC EXE asynchronous communication module

VSL INT TCP/ P transmission initialization file

WINSOCK DLL Windows socket dynamic link library

The MSOCKLIB DLL maps Windows socket calls to VSL drivers.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

If TCP/IP products are not Winsock-compatible InterBase client applications, other TCP/ P drivers can also be used, and InterBase servers can also support other communication protocols such as SPX/ PX NetBeIU.

Solve general connection problems

If there is a problem in establishing a connection with the InterBase server using SQL links, you can take the following steps to find out the cause of the problem.

⑴ Test whether you can connect to InterBase server through Windows ISQL tools.

If a success status message will appear, continue with step (2).

If you don't successfully ask the database administrator

⑵ Check whether the InterBase SQL Links driver is installed correctly.

(3) reinstall the SQL link.

(4) Check the lines in the service file.

gds_db /tcp

If it cannot be installed correctly, please ask the database administrator or continue with step 5.

5] Test the underlying protocol.

① Enter the TELNET command to confirm whether the TCP library is installed correctly.

If the TCP library is installed correctly, a registration prompt will appear to register the network and check whether the database exists.

If the message "Host name cannot be resolved" appears, please check whether your host name and IP address exist in the host file of the workstation, for example.

Mis _ server

If TELNET is successful, but the connection is still not correct, it means that InterBase is not installed correctly. Please look for it.

Ask the database administrator for help.

(2) ping the server server to test whether InterBase server is running normally and visible to desktop applications.

(If the PING is successful, the message servername is active will be displayed. )

If PING succeeds but TELNET fails, there may be a problem with the inet daemon.

If the PING to the server is unsuccessful, there is a network path problem and the problem is reported to the network administrator.

If the underlying protocol is abnormal, please ask the database administrator or continue to help [6]

[6] Verify that you can access the InterBase server. If so, please continue to step [7].

(7) Check whether InterBase alias of BDE application is installed correctly.

If you can connect directly from the workstation, but not from the BDE application, it is likely that your

There is a problem with the setting of IDAPI CFG alias. Run the BDE configuration tool to check the InterBase alias.

Delphi client/server programming

This section introduces how to use Delphi visual development tool and ObjectPascal language to develop the database application of client \ server. The example used is CSDEMOS, which is an example of demo client \ server development developed by Delphi itself. It is installed in c: \ program files \ borland \ Delphi \ demos \ db \ csdemos (default installation).

This section will contain the following contents

● use TDatabase component to connect to SQL server.

● Use data set components such as TTable and TQuery (also known as data set components) to connect the TDatabase component, access the database and how to switch between various tables.

● Use database connection.

● How to use triggers

How to use tstoredproc component

● Transaction control between client and server.

How to use tstoredproc component

Use TDatabase widget to join SQL server.

T database components overview

The TDatabase component handles the connection between an application and a single database. If you don't need to control database connections, you don't need to create a TDatabase component. When an application tries to open a database table, it automatically creates a temporary TDatabase component. However, if you want to control the continuous connection of the database to the database server registration and the value or transaction control of the database alias, you must create a TDatabase component for each required connection.

Create a t database part

T the database widget is located on the data access page of the component panel. You can drag and drop it into a data module or form to create a TDatabase widget at design time. Users can set the initial value and write the handle of OnLogin event) OnLogin event provides users with the ability to customize server security parameters (such as password) when registering a database server for the first time.

Key attributes of t database

(1) database name attribute

DatabaseName is the name of the database to be connected, which is used in dataset software. It will appear in the drop-down list box of dataset properties in the dataset section. Setting dataset properties is a specific alias that defines the database application. This name can be referenced in the dataset part instead of using the BDE alias directly. When the connected property of the TDatabase section is True, it cannot be modified.

⑵ Alias attribute

AliasName is the name of the BDE alias defined by the BDE configuration tool, from which TDatabase gets the default settings. If the DrivenName property is set, it will be cleared. If the DrivenName property is forced to be set when Connected is True, an exception will be thrown.

(3) Driver name attribute

DriveName is the name of a BDE driver, such as standard ORACLE SYBASE INFORMIX or INTERBASE. If AliasName is set, the property value will be cleared.

(4) Parameter attributes

The Params property contains the parameters needed to open the database on SQL server. By default, these parameters are set by the BDE configuration tool, and users can also modify these parameters by using the database parameter editor. For database server, Params will describe a series of parameters such as server name, database name, user name and password.

5] Connection properties

The Connected property indicates whether to establish a connection to the database; When an application opens a table in a database, Connected will be set to True. On the other hand, a closed database table will be set to False. Unless KeepConnection is True and Connected is set to True, a database connection can be established without opening the database table. The KeepConnection property of TDatabase describes whether the database connection is maintained when there are no open tables in the database.

[6] Keep connection properties

Lishi Xinzhi/Article/program/Delphi/20 13 1 1/25 129