Access violation at setting FetchAll option

Access violation at setting FetchAll option

Postby 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;
alexer
 
Posts: 29
Joined: Tue 26 Dec 2006 14:07

Re: Access violation at setting FetchAll option

Postby 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;
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Access violation at setting FetchAll option

Postby alexer » Wed 23 Jan 2013 09:44

Thanks, it helps.
alexer
 
Posts: 29
Joined: Tue 26 Dec 2006 14:07

Re: Access violation at setting FetchAll option

Postby 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.
AlexP
Devart Team
 
Posts: 5530
Joined: Tue 10 Aug 2010 11:35


Return to dbExpress driver for Oracle