I am writing a program that uses two modules, a VCL win32 application module and a Datamodule to contain ADO components and a clientdataset to work the data in memory.
When compiling the code fails with the message Raised Exception class EAccessViolation in Module EstimateMngr.exe. The debugger shows failrue in the following code:
procedure TForm3.ResetDataSets; begin //Fails in next line at the IF statement IF DataModule3.TaskClientDataSet.Active THEN DataModule3.TaskClientDataSet.Close; DataModule3.ADOTaskTable.ConnectionString := AccessCxHelper.CXString; DataModule3.TaskClientDataSet.Open; End;
The DataModule unit is in the uses clause. Tracing the execution shows that once it finishes reading the first line, it jumps to a function VirtualQuery in the Windows unit, then to GetModuleFileName in Windows, and then into the process to raise the exception.
Does anyone have suggestions?