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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Violations

Status
Not open for further replies.

phil2k

Technical User
May 2, 2003
21
GB
Hi

Can someone please tell me what causes Access Violations. We have got a Delphi based database application (purchased from an external company, so we can't decompile it) that is very annoying because it causes a lot of these errors. It seems to be only certain PC's but they are all running Windows XP Pro (maybe there is something wrong with the setup)

All help and suggestions will be gracefully received.

Thank you in advance

Phil



 
An Access Violation occurs when a program tries to read or write to an invalid memory address.

You can easily create an Access Violation by trying to access an object without first creating it.

For example
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
  s: TStringList;
begin
// s := TStringList.Create;
  s.LoadFromFile( 'c:\myfile.txt' );
end;
As the statement to create the StringList has been commented out, the pointer s still contains nil when it tries to load the file and hence an Access Violation occurs.

As you've purchased the program from an external supplier you should contact them and describe the fault and the circumstances in which it occurs. They are likely to want to know quite a few details about operating system, database, hardware set up and so on.

They may be well aware of the problem but are looking for more indicators on what is causing it.

Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top