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 开发者_JAVA技巧know the explanation of 'access violation' - can someone please explain this to me and help me avoid this error.
Thank you.
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.
it can be because the dataset is inactive/closed when you try to access it.
精彩评论