Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to connect Oracle with Delphi BDE?

Re: How to connect Oracle with Delphi BDE?

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Mon, 03 Feb 2003 08:19:55 +0000
Message-ID: <b1l1n3$o0f$1@ctb-nnrp2.saix.net>


Markus Schmidt wrote:

> In Oracle I have the database glob and the
> user test for the database glob.

<snipped>

This should have been posted in a Delphi newsgroup instead. It has very little to do with Oracle.

First make sure that your Oracle client software is working. TNSPING, SQL*Plus and so on. This eliminates any possible Oracle client issues, like an incorrect TNSNAMES.ORA, from the equation.

In Delphi, do *not* use the BDE Manager to create Oracle aliases. That is IMO stupid and makes deployment of Delphi apps for Oracle many times more complex.

The simplest, easiest and most flexible way is to put a TDatabase object on your form. Set the (BDE) driver name to ORACLE. This tells the object which BDE driver to use. Note that the ALIASNAME must be blank - you do not need it.

Assign a NAME to the object. Click on the PARAMS property of the the object and enter the following:
SERVER NAME=<tns alias name>
USERNAME=<oracle user name>
PASSWORD=<oracle user's password?

E.g.
SERVER NAME=mydatabase
USERNAME=scott
PASSWORD=tiger

The parameter assignment can also be done dynamically via the method ADD of the PARAMS property,
E.g.
begin

  MyDatabase.Params.Clear;
  MyDatabase.Params.Add( 'Server Name=prod.world' );
  MyDatabase.Params.Add( 'UserName=scott' );
  MyDatabase.Params.Add( 'Password=tiger' );
  MyDatabase.Connected := true;

end;

It is very simply to create your own dialog class to popup a dialog box that prompts the user for the Oracle TNS names, username and password. You then take the results of the dialog entry and put it into the PARAMS property using the ADD method as above.

No BDE Manager hacking. No need to create aliases. No need to distribute BDE config files. No need to merge distributed BDE config files with an existing BDE config.

--
Billy
Received on Mon Feb 03 2003 - 02:19:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US