Access violation at setting FetchAll option

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
alexer
Posts: 29
Joined: Tue 26 Dec 2006 14:07

Access violation at setting FetchAll option

Post by alexer » Fri 18 Jan 2013 09:24

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;

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Access violation at setting FetchAll option

Post by AlexP » Fri 18 Jan 2013 10:18

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;

alexer
Posts: 29
Joined: Tue 26 Dec 2006 14:07

Re: Access violation at setting FetchAll option

Post by alexer » Wed 23 Jan 2013 09:44

Thanks, it helps.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Access violation at setting FetchAll option

Post by AlexP » Wed 23 Jan 2013 09:51

Hello,

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

Post Reply