Oracle Objects for OLE and Application in VB

zhaozj2021-02-17  53

Oracle Objects for OLE and Application in VB

---- Generally speaking, visit the remote background data library all through ODBC. However, ODBC has a defective shortcomings - slow speed. In fact, for the Oracle Database, in addition to ODBC, we can use Oracle Objects for OLE to use Oracle Objects for OLE to realize the data library. In Oracle V8, Oracle Objects For OLE (hereinafter referred to as "provides a common development tool for communication access, which supports various development environments that support VB custom controls or OLE Automation. . OO master is divided into three parties:

Oracle Oracle Oracle Oracle Oracle Data Access Control (The Oracle Objects for Ole C Class Library)

---- OO master to include the object and use:

---- ORACLIENT definition domain, and manages session set. ---- ORASESSION managerial data library object set and provides shared connectivity and transaction control. ---- ORACONNECTION is connected to Oracle data. ---- ORADATABASE is a "virtual" login to the Oracle Database. ---- ORAPARAMARRAY group. ---- ORAPARAMETER is bound to have a variable variable in the SQL statement or PL / SQL block. ---- ORADYNASET uses the record obtained by the SELECT statement. ---- ORASQLSTMT predefined single single SQL statement. ---- ORAFIELD ORADYNASET object column (Column). ---- The following figure shows the relationship between the three components of OO and the Oracle Database.

.

.

.

---- The picture below is the relationship between the pairs:

.

.

.

---- The next surface is VB as an example, the main thing to talk about the Oracle Oracle Object Server and the Oracle Data Control are relevant.

First, Oracle Data Access Control (The Oracle Data Control)

---- To use Data Access Control ORADC (Oracle Data Control) in VB to add parts ORADC.OCX (usually it placed in bin directory under Oracle's default path), then Add an ORADC on the Form to see its related properties, you can see that it is the same as the RDO (Remote Data Object) belled in VB, with two attributes of Connect and DatabaseName. But note, the filling of the property here is different from RDO. Database is added to HostString in Oracle settings, and Connect needs to fill in the username and password, such as: ---- ... ...

Second, Oracle object server (the Oracle Object Server)

---- In VB, ORASESSION, ORADATABASE, ORADYNASET Divide the RDO, RDONECTION, RDOENVIRONMENT, RDORESULTSET, the RDORESultSet, and the RDORESultSet, and the RDORESULTSET.

---- ... ...

---- In addition to simply visiting the data library, you can use the Oracle object with parameters to call Oracle's storage and PL / SQL blocks.

---- The program sequence of the lower surface calls the Oracle process to realize the function of the name of the name of the name of the human code.

---- Oracle Process:

Procedure Getage

(userid in char, usrage out number) IS

Begin

Select agn userage

From userinfo where usercode = userid;

End getage;

VB program segment:

SUB FORM_LOAD ()

...

---- It is worth noting that in the above example, we use the createSQL statement to establish an ORASQLSTMT object, in fact, if we need to execute a Non-SELECT SQL statement, we can use the ExecuteSQL statement, the statement can return to execute Rows. In practice, it has become an ORADYNASET object.

转载请注明原文地址:https://www.9cbs.com/read-30600.html

New Post(0)