TOraLoader: OraClient11.Dll error

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
crucifix
Posts: 4
Joined: Mon 10 Jan 2011 08:09

TOraLoader: OraClient11.Dll error

Post by crucifix » Wed 24 Aug 2011 07:02

Hi.

I'm new user of ODAC.
I have the latest stable version and using Delphi 2007.
I tried to use TOraLoader, but I can't even compile project and Delphi returns me an error.

My code is like this:

Code: Select all

unit aOraLoader;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBAccess, Ora, DALoader, OraLoader, Buttons, BCBtns;

type
  TForm1 = class(TForm)
    OraSession1: TOraSession;
    OraLoader1: TOraLoader;
    ExtSpeedButton1: TExtSpeedButton;
    procedure ExtSpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ExtSpeedButton1Click(Sender: TObject);
begin
  OraLoader1.PutColumnData(0,1,'ABDUL');
  OraLoader1.PutColumnData(1,1,17);
  OraLoader1.Load;
end;

end.
When I compile, Delphi returns: [DCC Error] F2092 Program or unit 'ORALOADER' recursively uses itself

What am I doing wrong? In this example I try to insert one row in first field (type string) and second field (type number).
Thanks for help.
Last edited by crucifix on Wed 24 Aug 2011 09:16, edited 1 time in total.

crucifix
Posts: 4
Joined: Mon 10 Jan 2011 08:09

Post by crucifix » Wed 24 Aug 2011 09:12

I created new project with same code and the code is fine I guess.
Now I got other error, after first statement is executed (OraLoader1.PutColumnData(0,1,'ABDUL');):
Access violation at address 62CDF5EC in module 'OraClient11.Dll'. Read of address 00000010.
Does anyone know why?

I have installed Oracle client(x86) 10g and 11g. Default is 11g on WinXP. I'm using DB 11gR2.

AndreyZ

Post by AndreyZ » Wed 24 Aug 2011 10:41

Hello,

You are using the TOraLoader component incorrectly. You should use the OnPutData event handler in the following way:

Code: Select all

procedure TForm1.ExtSpeedButton1Click(Sender: TObject); 
begin 
  OraLoader1.Load; 
end;

procedure TForm1.OraLoader1PutData(Sender: TOraLoader);
begin
  OraLoader1.PutColumnData(0,1,'ABDUL');
  OraLoader1.PutColumnData(1,1,17);
end;
You can also look at the example of the TOraLoader component using in ODACDemo. You can find ODACDemo in the %ODAC_Install_Directory%\Demos directory.

crucifix
Posts: 4
Joined: Mon 10 Jan 2011 08:09

Post by crucifix » Wed 24 Aug 2011 10:47

thanks, it works. :wink:

Post Reply