Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Restore 11013 Error - Can't make it work...
Wed, Feb 22 2012 6:51 PMPermanent Link

Allan Roberts

Why is it impossible to restore a local database?  I continue to receive a
11013 (access denied) error, and I have tried every suggestion that I have
seen in various newsgroups and forums.  I am using C/S v4.28 build 4 under
Delphi5 with Vista64, with a local session.  The Backup/Restore file is
located in a folder that is not under a Program Files folder (I created one
called c:\application\, and the tables are located in the same folder as the
executable.  The session private directory is set to the same location (I've
tried a variety of them without success).  There is no A/V running.  There
is no problem accessing or writing to the tables from the application.

Here is the code for Restore, which seems to be straightforward enough.
What am I missing?


var BackTables:TStrings;

begin

BackTables := TStringList.Create;
CurDir := ExtractFilePath(Application.EXEName);

   try
   with dm1.DBISAMDatabase1 do
   begin
   with BackTables do
   begin
   Add('Users');
   Add('Audit');
   Add('Events');
   Add('Locks');
   Add('Global');
   end;

if Restore(CurDir + 'CTBackup' + '.bkp',BackTables) then
ShowMessage('Restore was Successful')
else
ShowMessage('Restore Failed');
end;

finally
BackTables.Free;

end;
Wed, Feb 22 2012 11:05 PMPermanent Link

Raul

Team Elevate Team Elevate

Allan,

Have not done this in a while but assuming your database name and folder is set properly i think you need also set Connected := true for the database component before you call Restore.

Other thing to try is to do restore in dbsys - if that works then that eliminates any system related aspects.

Raul

<<

Allan Roberts wrote:

Why is it impossible to restore a local database?  I continue to receive a
11013 (access denied) error, and I have tried every suggestion that I have
seen in various newsgroups and forums.  I am using C/S v4.28 build 4 under
Delphi5 with Vista64, with a local session.  The Backup/Restore file is
located in a folder that is not under a Program Files folder (I created one
called c:\application\, and the tables are located in the same folder as the
executable.  The session private directory is set to the same location (I've
tried a variety of them without success).  There is no A/V running.  There
is no problem accessing or writing to the tables from the application.

Here is the code for Restore, which seems to be straightforward enough.
What am I missing?


var BackTables:TStrings;

begin

BackTables := TStringList.Create;
CurDir := ExtractFilePath(Application.EXEName);

   try
   with dm1.DBISAMDatabase1 do
   begin
   with BackTables do
   begin
   Add('Users');
   Add('Audit');
   Add('Events');
   Add('Locks');
   Add('Global');
   end;

if Restore(CurDir + 'CTBackup' + '.bkp',BackTables) then
ShowMessage('Restore was Successful')
else
ShowMessage('Restore Failed');
end;

finally
BackTables.Free;

end;
>>
Thu, Feb 23 2012 12:47 PMPermanent Link

Allan Roberts


Raul,

Thanks for your reply.  I tried your suggestion, and used dbsys.  That worked perfectly, as long as my application wasn't running.  If my app is running, then I receive the same error.  I included the Connected := true, as you suggested, but it made no difference.  This is really a strange one, and appears to be about needing exclusive access to the tables...

Regards,
Allan



Raul wrote:

Allan,

Have not done this in a while but assuming your database name and folder is set properly i think you need also set Connected := true for the database component before you call Restore.

Other thing to try is to do restore in dbsys - if that works then that eliminates any system related aspects.

Raul

<<

Allan Roberts wrote:

Why is it impossible to restore a local database?  I continue to receive a
11013 (access denied) error, and I have tried every suggestion that I have
seen in various newsgroups and forums.  I am using C/S v4.28 build 4 under
Delphi5 with Vista64, with a local session.  The Backup/Restore file is
located in a folder that is not under a Program Files folder (I created one
called c:\application\, and the tables are located in the same folder as the
executable.  The session private directory is set to the same location (I've
tried a variety of them without success).  There is no A/V running.  There
is no problem accessing or writing to the tables from the application.

Here is the code for Restore, which seems to be straightforward enough.
What am I missing?


var BackTables:TStrings;

begin

BackTables := TStringList.Create;
CurDir := ExtractFilePath(Application.EXEName);

   try
   with dm1.DBISAMDatabase1 do
   begin
   with BackTables do
   begin
   Add('Users');
   Add('Audit');
   Add('Events');
   Add('Locks');
   Add('Global');
   end;

if Restore(CurDir + 'CTBackup' + '.bkp',BackTables) then
ShowMessage('Restore was Successful')
else
ShowMessage('Restore Failed');
end;

finally
BackTables.Free;

end;
>>
Thu, Feb 23 2012 1:41 PMPermanent Link

Raul

Team Elevate Team Elevate

Allan,

Sorry i had misunderstood originally - you cannot have any of the tables (or queries against the affected tables) open. Your app would need to close all the tables and queries, do restore and then reopen them.

Backup does not have the same restriction since in case of backup the table and record state would not change (unlike for restore).

Raul


Yes you can't have any of the tables open (or queries open against the tables involved in restore)

<<Thanks for your reply.  I tried your suggestion, and used dbsys.  That worked perfectly, as long as my application wasn't running.  If my app is running, then I receive the same error.  I included the Connected := true, as you suggested, but it made no difference.  This is really a strange one, and appears to be about needing exclusive access to the tables...
>>
Fri, Feb 24 2012 2:51 PMPermanent Link

Allan Roberts

Raul,

Thanks, that was the insight that I needed.  It works perfectly now.  I appreciate your help.

Regards,

Allan


Raul wrote:

Allan,

Sorry i had misunderstood originally - you cannot have any of the tables (or queries against the affected tables) open. Your app would need to close all the tables and queries, do restore and then reopen them.

Backup does not have the same restriction since in case of backup the table and record state would not change (unlike for restore).

Raul


Yes you can't have any of the tables open (or queries open against the tables involved in restore)
Image