A simple application written in Delphi 2007 causes an access violation error on closing the program. I have a form with two buttons, a TDBGrid, TMyConnection, TMyTable, TMyDataSource and the following code:
procedure TForm1.Button1Click(Sender: TObject);
begin
MyConnection1.Database := xy';
MyConnection1.Server := 'anyserver.com';
MyConnection1.Username := 'TheUser';
MyConnection1.Password := 'pswrd';
MyConnection1.Connect;
MyTable1.Open;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
MyTable1.Close;
MyConnection1.Disconnect;
end;
Executing the program from the IDE and push button1 the table will be shown in the Grid. Then push button2 the table will be closed.
You can push the buttons several times, everthing works fine.
But closing the programm, caused an access violation. I have to reboot the computer, because breaking the programm with Ctrl+F2 results, that the programm will not run a second time.
Directly in the IDE, switching the TMyConnection Active to true/false works with no errors.
Starting and closing the demo-application not from the IDE works correct.
Using Windows Vista (Business) 32-Bit, SQL Server-/Client-Version is 5.0.18, language is german. MyDAC is a trial, version is 5.20.1.14.
[EDIT 5.3.2008 14:56]
Installed now the licensed version, nothing changed. When executing the programm from the IDE, I got the access-violation. Delphi version is 11.0.2804.9245 (latest available update).
[EDIT 6.3.2008 11:32]
The same problem with "MyDacDemo" if I connect and disconnect to my database.
The same behaviour on a XP-Machine (SP2).
Is there anybody who use Delphi2007 Prof. (Update 3) and MyDAC 5.20.1.14 (registered version) and can confirm (or not) this behaviour?
Gerhard