Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me with ... EAccessViolation

Status
Not open for further replies.

PaidtheUmpire

Programmer
Jan 4, 2004
105
AU
Using DELPHI 7 which uses ADO to access a Microsoft Access Database...

I have a program which calls the following function, when created:

Code:
procedure TForm1.FormCreate(Sender: TObject);
begin
  PageControl1.ActivePageIndex := 0;
  StatPageOne;
end;

Which calls the StatPageOne function...

Code:
procedure TForm1.StatPageOne;
label StatFour, StatSeven;
var RowNo, Games, Value : integer;
begin
GridStat1.ColWidths[2] := 80;
GridStat1.Cells[1,0] := 'Pins';
GridStat1.Cells[2,0] := 'Average';
RowNo := 1;
DataFolder.Stat1.Active := True; <-------------------   //HIGHLIGHTS THIS LINE
  if DataFolder.Stat1.RecordCount > 0 then
    while not DataFolder.Stat1.EOF do
      begin
        GridStat1.Cells[ 0,RowNo] := DataFolder.Stat1.Fields[ 0].AsString;
        GridStat1.Cells[ 1,RowNo] := DataFolder.Stat1.Fields[ 1].AsString;
        GridStat1.Cells[ 2,RowNo] := DataFolder.Stat1.Fields[ 2].AsString;
        DataFolder.Stat1.Next;
        Inc(RowNo);
      end;
GridStat2.ColWidths[1] := 110;
GridStat2.Cells[1,0] := 'Game High';
RowNo := 1;

// etc. etc.

I keep getting the following error:
"Project ***.exe raised an exception class EAccessViolation ..... ....."

Any help would be very very helpful :p

Delphi, Delphi, Delphi. Oi! Oi! Oi!
 
......
Stat1.Active := True;
......
if Stat1.RecordCount > 0 then
......

DataFolder in in ConnectionString

Giovanni Caramia
 
What do you mean by that?

Please Explain further...

Delphi, Delphi, Delphi. Oi! Oi! Oi!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top