Hi,
Sorry but I could not fix the bug with your last solution, but I have more information for you.
I did more test and now I can reproduce the problem on my own computer.
Steps to reproduce the bug:
1. Create VCL Application program and copy the following code source to it
Code: Select all
unit WinTest;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Ora, System.ComponentModel, Borland.Vcl.StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
oSession: TOraSession;
oCommand: TOraQuery;
public
{ Public declarations }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
var
Form2: TForm2;
implementation
{$R *.nfm}
{ TForm2 }
procedure TForm2.Button1Click(Sender: TObject);
begin
try
oCommand.Open;
ShowMessage(
oCommand.SQL.Text+sLineBreak+
'RecordCount: '+oCommand.RecordCount.ToString);
oCommand.Close;
oSession.DisConnect;
except
on e: exception do
ShowMessage(e.ToString);
end;
end;
constructor TForm2.Create(AOwner: TComponent);
begin
inherited;
oSession := TOraSession.Create(nil);
oCommand := TOraQuery.Create(nil);
oSession.Server := 'MYBASE';
oSession.Schema := 'MYSCHEMA';
oSession.Username := test;
oSession.Password := test;
oSession.Connect;
oCommand.Session := oSession;
oCommand.SQL.Text :=
'-- ceci est un ééé éà àéàéà commantaire àéàéà'+sLinebreak+
'Select * from MY_TABLE '+sLinebreak+
'-- àéàéàé ';
end;
destructor TForm2.Destroy;
begin
inherited;
FreeAndNil(oSession);
FreeAndNil(oCommand);
end;
end.
2. Compile your application and save it
3. Open computer “Regional and Language Options” from control panel.
Change your language to Chinese (PRC) in the “regional Options” TabSheet .
Change the “Language for non-unicode program” to Chinese (PRC) to the “Advanced” TabSheet
Restart your computer.
4. Test your saved application.
Just for information, I tested the same application using OracleConnection and OracleCommand from the System.Data.OracleClient namespace of the .Net Framework and it works !
So I deduct that the problem comes from ODAC.
I hope that you can help me to fix this bug.
Thank you,
Maurizio.