Go Premium for a chance to win a PS4. Enter to Win


Connecting to Oracle

Posted on 2001-08-13
Medium Priority
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
  • 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 http://www.borland.com/devsupport/bde/files/sqlora8_512.zip
It fixes very annoying bug in the BDE.

More info on

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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 800 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

824 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