Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Restore not working
Thu, Jul 2 2009 1:51 PMPermanent Link

Pete Hollyer
Tim

Like everyone else here I cannot get past the error 300 "Cannot lock the database ListBuilder fore exculsive access"

So...my solution was to write a standalone program...one 1 class...with 1 connection..and still I get this error.
The EDBManager is NOT open.
What gives?

I am 100% certain that there is ONLY 1 connection to the database....
I create it..
Create the Store
Close Connection
Open Connection
Do the Restore

and I get the error.

It seems to me that it is seeing its OWN Connection...my only other thought is that there is some obscure parameter needed for this connection
that is not mentioned anywhere

           //make my own connection
           EDBConnectionStringBuilder csb = new EDBConnectionStringBuilder();
           csb.Name = "ListBuilderConnection";
           csb.Description = "ListBuilder Connection Object";
           csb.Type = "LOCAL";
           csb.ConfigPath = WorkAppPath.AppPath + "\\Database";
           csb.Database = "ListBuilder";
           csb.UID = "Administrator";
           csb.PWD = "EDBDefault";

           EDBConnection DBConn = new EDBConnection(csb.ConnectionString);

           EDBCommand dbCommand = new EDBCommand();

           DBConn.Open();

               //Create Store
               SQL = "CREATE STORE \"Backups\"";
               SQL += " as LOCAL PATH '" + WorkAppPath.AppPath + "\\Backups\\' ";
               SQL += " DESCRIPTION 'ListBuilder Database Backup' ";

               dbCommand = new EDBCommand(SQL, DBConn);
               dbCommand.ExecuteNonQuery();

                DBConn.Close();

               DBConn.Open();

               SQL = "RESTORE DATABASE ListBuilder ";
               SQL += " FROM \"Martha\" ";
               SQL += " IN STORE \"Backups\"  ";

               dbCommand = new EDBCommand(SQL, DBConn);
               dbCommand.ExecuteNonQuery();
Thu, Jul 2 2009 10:22 PMPermanent Link

Pete Hollyer
Okay Tim

Confirm my findings....


The reason I was getting the error 300 "Cannot lock the database ListBuilder fore exculsive access" was because the connection I was using to DO
the RESTORE was on the Database I was trying to restore...My solution was to build a second Database called BackUpDB in the same folder...and
when I restored my Listbuilder Database I use a connection to the BackupDB (which has no tables or anything)...this allows the SQL Command to
execute on the ListBuilder Database because it now has NO connections open on him!!

Pete
Fri, Jul 3 2009 1:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Pete,

<< Like everyone else here I cannot get past the error 300 "Cannot lock the
database ListBuilder fore exculsive access" >>

See my other post on this - it's your code and is not an issue with EDB.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image