Connecting to Oracle

Posted on 2001-08-13
Last Modified: 2013-11-23

maybe this is trivial, but well, it doesn't work, hehe.

Here is my problem : I have a little program, which have to connect to an Oracle Database.
the database is on the Local network. My program "just" need to connect to the server and check a table every 10 mins or so, but actually, i have no idea on how to connect to the base.
I guess i have to use BDE administrator to create an alias and use it on my form, but not sure.
Well, i am looking for help to do this :)
Any comments and ideas are welcome....

Thank you.
Question by:jacoby
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
  • 4
  • 2
  • 2
  • +1

Expert Comment

ID: 6380233
First of all you should have the Oracle client installed and working on the machine where you want to run the program.
If you have that, you can create an proper alias in BDE for the connection with Oracle and use that one


you can use a TDatabase with driver=ORACLE but you'll have to set up the DB params by yourself in the code (a + is that the user will be less likely to mess with the settings as in the alias case)

I would use after that a TQuery containing a well-thought "select" statement to minimize the traffic on the net. (a.k.a. TQuery _not_ TTable )

Please call for further suggestions if I was too brief.


Expert Comment

ID: 6380246
BTW, there are some known issues about connection between BDE and Oracle. Please post the versions of BDE and Oracle used. Delphi's version might help, too.


Expert Comment

ID: 6380275
You have to download Updated Oracle 8 SQL Links Driver (197,710 bytes) from
It fixes very annoying bug in the BDE.

More info on

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6380302

  here's 3 ways to connecting to Oracle

 to use the ado, you should have D5 enterprise edition, or if you have D5 Pro, you can buy ADOExpress
from borland store

1) Native Connection:

Go to the BDE Administrator, you need to make new alias here
from Object menu > New > Database driver name > Oracle
now you have new alisa called oracle1, or any thing you chose
you need to change some of oracle1 properties:
Server Name : OraServer (it's will be oracle service name in your machine)
Just insure net protocol is : TNS
choose apply for the alias
 now you have new alias connected to oracle, and you can access to it via
the table and query component like you connect to paradox or access

2) ADO

  this require you have delphi 5 enterprise edition, or delphi 5 pro with
ado express

from delphi in component palette switch to ADO

drop in the form ADOTable component
from object inspector we need to modifiy some properties of ADOTable

ConnectionString : double click on it
you will see new window, choose : use connection string then press Build
you will see datalink window now from provier tab choose > microsoft OLE DB
provider for oracle  then press next button
now in connection tab enter the following

Enter a server name : OraServer (oracle service name in your machine not the
alias name you created befor)
and enter the user name and password
click to check allow saving password check box
then click on Test connection, if it give you message "Test connection
Succeeded" that's mean you are connect now to oralce
then press ok button to close the this window and ok agian to close ado
connection window

again back to object inspector and now choose table name

go to contorl panel, and than choose 32bit ODBC

in the user DNS tab choose Add, then choose Microsoft ODBC driver for oracle, then click finish
you will see now micosoft odbc driver for oracle setup dialog
in the dialog enter your informations
data source name : choose name to define the odbc for your application ( you will it as alias in BDE

description : any thing
user name: any user is exist in the oracle database(Scott for testing)
connection string: choose your oracle server name

I hope that working with you, but anyway, I think if you use delphi native connection or ado to connect

to oracle
database, both of them better and faster than odbc

if you have Delphi 6 enterprise edition, you could use the DBExpress also

to check the tables in the oracle database use this select statment
"select * from tab"

Best regards
Mohammed Nasman

Expert Comment

ID: 6380378
Mohammed is quite right. ADO is a new growing architecture, with big future. It allows you run away from BDE.

Native Connection is well-trained. Solid. :)

ODBC is something I don't use. Just imagine the system:
Layer 1: Database Server
Layer 2: Client for the database
Layer 3: ODBC
Layer 4: BDE
Layer 5: your program

In any of the layers there might be a bug. Less layers - less bugs :)
And, from my experience, Layers 3 and 5 have the biggest part of the bug-things. That's why I avoid using ODBC. Unfortunately L5 is unavoidable :)


Author Comment

ID: 6380490
oopps, my bad. I am using D5 enterprise, with BDE 5.01.
And Oracle is 8.06.

Oracle client is installed and work properly. (i'm working with Centura also, and it works well.)

Downloading and trying Frodo :)

Mohammed, i think that my problem is when i create the alias. i don't put the right name under servername. What should i put there ? the IP adress of the server and something else after that ?
I know that the name i put there is wrong as when i apply and check it again, it tells me invalid name ..

Thanks for your answers,

Fred Jacoby.
LVL 22

Accepted Solution

Mohammed Nasman earned 200 total points
ID: 6380651

  Did you try to connect the Oracle Client with the Oracle server with SQL Plus, what's the server name you use there?
it's will be the server Name in the OraServer in BDE Admin, it's the name you made with Net8 easy configuration

Try the ADO, you already have it, it's faster than the others ways, I test it with oracle, and it was faster than BDE


Expert Comment

ID: 6380653
The name should be the TNS name you can use e.g. to tnsping the Oracle connection or the name you fill in as service name in SQLplus or equivalent.


Expert Comment

ID: 6380713
Oops, I was trying to be helpful, but I only managed to unknowingly "quote" Mohammed. Sorry.

Author Comment

ID: 6380821
YAY !!
It works :)

Many thanks to you all.
Frodo, i am running BDE 5.01 and the patch is for 5.11, so i couldn't test it.
I am accepting Mohammed comment as answer as the test with ADO is nice and works really well.

Best regards,

Fred Jacoby.

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month7 days, 1 hour left to enroll

622 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