Borland C + + Builder 5 Enterprise Edition use BDE Access Oracle method

Source: Internet
Author: User
Tags insert modify connect resource table name
c++|oracle| Access


Borland C + + Builder 5 Enterprise Edition use BDE Access Oracle method

System environment:
1. Operating system: Windows Server
2. Database: Oracle 8i R2 (8.1.6) for NT Enterprise Edition
3, Development tools: Borland C + + Builder 5 Enterprise Edition

Connection method:

First, install Oracle 8i R2 (8.1.6) for NT Enterprise Edition
Use Typical installation, installation directory for D:\Oracle;

Second, install Borland C + + Builder 5 Enterprise Edition
Put the Borland C + + Builder 5 CD-ROM into the optical drive, using a typical installation,
The installation directory is C:\Program Files\borland\cbuilder5;

Iii. generation of Oracle Experimental Records
Connect to Sql*plus to System/manager user login
Sql> Conn System/manager

Create a new user: such as USER1/PASS1, give Connect,resource permissions.
Sql> Grant Connect,resource to User1 identified by Pass1;

Sql> Conn User1/pass1
Sql> CREATE TABLE Test (a number,b char (19));
sql> INSERT into test values (1,to_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss '));
sql> INSERT into test values (2,to_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss '));
sql> INSERT into test values (3,to_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss '));
sql> INSERT into test values (4,to_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss '));
sql> INSERT into test values (5,to_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss '));
Sql> commit;

Sql> select * from test;

A B
---------- -------------------
1 2000-11-28 20:27:33
2 2000-11-28 20:27:36
3 2000-11-28 20:27:38
4 2000-11-28 20:27:40
5 2000-11-28 20:27:52

D:\Oracle\Ora81\network\ADMIN\tnsnames.ora has the following contents:

Test =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = TCP) (HOST = 192.1.1.1) (PORT = 1521))
)
(Connect_data =
(service_name = oradb)
)
)

Summarize:
Oracle service_names:oradb
Oracle User name: User1
User name password: pass1
Testing table name: Test
Tnsnames:test

Iv. configuration of BDE
Start-> Program->borland C++builder 5->bde Administrator
1, configure drivers, modify the following several places.

Dll32:sqlora8. Dll
Vendor Init:oci. Dll
Langdriver:oracle SQL WE850
Sqlpassthru mode:shared Noautocommit

Clear server name and user name

After the modification, press the right mouse button, apply (Ctrl + a), submit changes

    

2, configure the database aliases (DB access alias), a new alias, named Oracle.

    
    

3, modify the following several places.

SERVER Name:test

    

After the modification, press the right mouse button, apply (Ctrl + a), submit changes, exit BDE Administrator

Re-open the BDE Administrator, double-click Alias Oracle with the left mouse button, and test the connection

    

Enter username, password, press "OK" to connect, can't write User1/pass1 directly on user name, write separately

    

Five, start Borland C + + Builder 5 Enterprise Edition, write to connect Oracle C + + Builder program
Start-> Program->borland C++builder 5->c++builder 5

File->new ... ->application.

The Toolbox panel at the top of the C + + Builder Development window:

    

Open the data Access control group, double-click the control table with the mouse, and then double-click the DataSource control to place it on the form Form1 with the default name Table1 and DataSource1:

    

Open the Data controls control group, double-click the DBGrid control with the mouse (red box in the picture above),
Put it on the form FORM1, the default name is DBGRID1,

    

Modify the properties of the control Table1, DataSource1, DBGRID1, Table1 active property: True
Table1 databasename attribute: Oracle (that is, BDE name selected)
TABLE1 TableName Properties: TEST (you need to connect Oracle here)

DataSource1 DataSet attribute: Table1

DBGrid DataSource Properties: DataSource1



Press F9, run this program, eject the login screen,

    

Enter the username and password and press OK.


Related Article

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: info-contact@alibabacloud.com 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.