boy
boy

Reputation: 11

Delphi : Error 'Access violation at address 00536983 in module '

My code :

if dataset.IsEmpty then 
  DoSomething(x);

When 'if dataset.IsEmpty' runs l get the following error: 'Access violation at address xxxxxxxxx in module abc'

Why am I getting this error? I don't know the explanation of 'access violation' - can someone please explain this to me and help me avoid this error.

Thank you.

Upvotes: 1

Views: 9027

Answers (2)

more2chance
more2chance

Reputation: 31

it can be because the dataset is inactive/closed when you try to access it.

Upvotes: 1

Lars Truijens
Lars Truijens

Reputation: 43602

See here for an explanation on AV exceptions and how to debug them. The solution could be as simple as checking if dataset is assigned, as RRUZ suggests, but we would never know with this little information. Showing us the exact error message will help to rule out some cases.

Upvotes: 1

Related Questions