Delphi program compiles but doesn't run

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lgojer

Delphi program compiles but doesn't run

Post by lgojer » Fri 12 Nov 2004 13:20

I created a delphi program that has a variable of type
TOraSession. In the program, it sets the server, user name,
and password, and then there is the line: OraSession1.Connect;
where it bombs when running. (In other words, it compiles,
but fails to initialize the Session variable correctly) What code
do I have to have to initialize a TOraSession correctly? I tried
New(OraSession1);, and it told me "incompatible types" in the
compiling stage.

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 15 Nov 2004 07:21

As I can see from your sources you forget to create the instance of the object. Please add the following code line before using OraSession1 variable. OraSession1 := TOraSession.Create(nil);

Guest

Thank You

Post by Guest » Mon 15 Nov 2004 14:48

Thank You very much for your help. It worked perfectly.

Post Reply