I am using TADOTable, TDataSetProvider and TDataSource for each table in my access database. The application need to typical work like word or excel, in that when you open the program you start with a clean file, and then you can save this file, or load a already saved one.
I am using the following code to load a database file, but clearly I am missing something:
If OpenDialogSite.Execute Then
Begin
Dir := ExtractFilePath( Application.ExeName );
ADOTablePanels.Close;
ADOTableSite.Close;
WorkingFileName := Dir + 'DBs\Site.mdb';
OpenFileName := OpenDialogSite.FileName;
CopyFile(PChar(OpenFileName),PChar(WorkingFileName),False);
ADOTablePanels.Open;
ADOTableSite.Open;
End;
With Site.mdb containing both Panels table and Site table.
When I try to change data in the tables afterward, I get the error “The microsoft jet database engine has stopped the process because you and another user are attemping to change the same data at the same time”. My application runs on a single PC, and is not a remote server type application. Which means only I am accessing the database. However somehome I must be accessing it twice?
Any suggestions welcome, as I have been stuck for quite a few days already.
I am using the following code to load a database file, but clearly I am missing something:
If OpenDialogSite.Execute Then
Begin
Dir := ExtractFilePath( Application.ExeName );
ADOTablePanels.Close;
ADOTableSite.Close;
WorkingFileName := Dir + 'DBs\Site.mdb';
OpenFileName := OpenDialogSite.FileName;
CopyFile(PChar(OpenFileName),PChar(WorkingFileName),False);
ADOTablePanels.Open;
ADOTableSite.Open;
End;
With Site.mdb containing both Panels table and Site table.
When I try to change data in the tables afterward, I get the error “The microsoft jet database engine has stopped the process because you and another user are attemping to change the same data at the same time”. My application runs on a single PC, and is not a remote server type application. Which means only I am accessing the database. However somehome I must be accessing it twice?
Any suggestions welcome, as I have been stuck for quite a few days already.