Page 1 of 1

Access violation at setting FetchAll option

Posted: Fri 18 Jan 2013 09:24
by alexer
Hi we work with Delphi 7+Oracle 11+dbxoda 6.1.2
When im trying to set FetchAll option to True or False, i get access violation.

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
const
  coFetchAll = TSQLConnectionOption(301); //boolean
begin
  SQLDataSet1.Close;
  SQLConnection1.Close;
  if CheckBox1.Checked then
    SQLConnection1.SQLConnection.SetOption(coFetchAll, Integer(True))
  else
    SQLConnection1.SQLConnection.SetOption(coFetchAll, Integer(False));
  SQLConnection1.Open;
  SQLDataSet1.Open;
end;

Re: Access violation at setting FetchAll option

Posted: Fri 18 Jan 2013 10:18
by AlexP
Hello,

These options should be set in the TSQLConnection.AfterConnect or TSQLDataSet.BeforeOpen event.

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  SQLDataSet1.Close;
  SQLConnection1.Close;

  SQLConnection1.Open;
  SQLDataSet1.Open;
end;

procedure TForm1.SQLConnection1AfterConnect(Sender: TObject);
const
  coFetchAll = TSQLConnectionOption(301); //boolean
begin
  if CheckBox1.Checked then
    SQLConnection1.SQLConnection.SetOption(coFetchAll, Integer(True))
  else
    SQLConnection1.SQLConnection.SetOption(coFetchAll, Integer(False));
end;

Re: Access violation at setting FetchAll option

Posted: Wed 23 Jan 2013 09:44
by alexer
Thanks, it helps.

Re: Access violation at setting FetchAll option

Posted: Wed 23 Jan 2013 09:51
by AlexP
Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.