Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Error #401 The database does not exist when creating a database
Thu, Jul 24 2014 12:44 PMPermanent Link

Michael

A am new to this so I suspect I am missing something. I am creating a migration app to move from DBISAM 4 to Elevate DB. My plan is to rename the DBISAM database directory  and create a new directory with the same name for the ElevateDB database. I then run this code:

   Engine.Active := False;
   Engine.ConfigPath := DestFolder;
   Engine.Active := True;

   Database.Execute(
   'CREATE DATABASE "NSiteData" ' +
   ' PATH '+QuotedStr(DestFolder)+' ' +
   'DESCRIPTION ''NSite Database'' ');
   
  

On the "Create Database" I get this error: Error #401 The database does not exist

Any help would be greatly appreciated. Thanks Michael
Thu, Jul 24 2014 1:23 PMPermanent Link

Uli Becker

Michael,

>      Database.Execute(
>      'CREATE DATABASE "NSiteData" ' +
>      ' PATH '+QuotedStr(DestFolder)+' ' +
>      'DESCRIPTION ''NSite Database'' ');

> On the "Create Database" I get this error: Error #401 The database does not exist

Are you using a component "database"? If so, this component has to be
bound to an existing database.

Instead, just use

Session.Execute(
      'CREATE DATABASE "NSiteData" ' +
      ' PATH '+QuotedStr(DestFolder)+' ' +
      'DESCRIPTION ''NSite Database'' ');

Uli
Thu, Jul 24 2014 3:49 PMPermanent Link

Michael

Thanks, that makes since.

Michael

Uli Becker wrote:

Michael,

>      Database.Execute(
>      'CREATE DATABASE "NSiteData" ' +
>      ' PATH '+QuotedStr(DestFolder)+' ' +
>      'DESCRIPTION ''NSite Database'' ');

> On the "Create Database" I get this error: Error #401 The database does not exist

Are you using a component "database"? If so, this component has to be
bound to an existing database.

Instead, just use

Session.Execute(
      'CREATE DATABASE "NSiteData" ' +
      ' PATH '+QuotedStr(DestFolder)+' ' +
      'DESCRIPTION ''NSite Database'' ');

Uli
Fri, Jul 25 2014 4:31 AMPermanent Link

Matthew Jones

Michael wrote:

>  and create a new directory with the same name

I considered that, but then chose to rename the new one. It lets you
know exactly where you are, and doesn't affect the old one at all which
is good from a restore point of view. By using a completely different
name you benefit from knowing you can't mix them up.

Just a thought...

--

Matthew Jones
Sat, Jul 26 2014 9:33 AMPermanent Link

Michael

"Matthew Jones" wrote:

Michael wrote:

>  and create a new directory with the same name

I considered that, but then chose to rename the new one. It lets you
know exactly where you are, and doesn't affect the old one at all which
is good from a restore point of view. By using a completely different
name you benefit from knowing you can't mix them up.

Just a thought...

--
Matthew Jones


Good idea, I think I will do that.
Image