Sometimes (sorry but I couldn't reproduce this), I'm getting "List index out of bounds (..)" errors while creating the TOracleQuery object.
I'm using D5, DOA 406 and Oracle 10g.
function TBlahBlah.CreateQuery(SQLLines : TStringList; Options : TCreateQueryOptions = [cqoExecute, cqoOptimize]; Session : TOracleSession = nil) : TOracleQuery;
var r: char;
begin
if Session = nil then
Session := FDefaultSession;
try
r := 'a';
result := TOracleQuery.Create(Application); // <<-- error
r := 'b';
result.Session := Session;
for i := 0 to SQLLines.Count - 1 do
result.SQL.Add(SQLLines[i]);
if cqoExecute in Options then
result.Execute;
if FDebug then
Notify('[TBlahBlah.CreateQuery]: ' + SQLLines.Text);
except
...
// log error message and value of r
...
raise;
end;
end;
I wonder whether replacing Application with Nil solves the problem, but I doubt it.
Any ideas?
Thanks in advance!