Subject Re: [firebird-support] Overwrite existing dtabase file when creating database
Author Helen Borrie
At 01:54 AM 14/01/2007, you wrote:
>I'm using windows xp,visual studio 2005, embeded version 1.5.3 and
>receive the following error when trying to create a new database file
>using overwrite set to TRUE to overwrite a previously created database
>file.
>
>here is my code:
>
>FbConnection.CreateDatabase(DBConnectionBuilder.ConnectionString, True)
>
>
>This is the error message:
>
>I/O error for CreateFile(create) "<filename>"
>Error while trying to create file
>
>
>It creates a new database file without any problems if the file doesnt
>exist.
>
>any help or suggestions would be greatly appreciated.

This sounds like exactly the correct behaviour. By design, the
underlying -r[eplace_database] switch is disallowed if the
authenticated user is not the owner of the database or the SYSDBA
user. Since the embedded server connects its embedded client without
authentication, the "user" is no user at all at the point where this
client makes its DROP DATABASE request and, fortunately, it fails.

As a matter of pure curiosity, have you considered the implications
of trying to design an embedded application that has the capability
to disembowel itself?

./heLen