#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    77
    Rep Power
    9

    Delete or drop database with ADOdb.command?


    Is it possible to delete a firebird database through an ADODB.command? I have tried the code below with no luck.

    dim Ct as adodb.command
    ct.activeconnection = Con
    ct.commandtext="drop database 'c:\test.fdb';"

    If not is there a way to force Firebird server to release a database on demand so it can be deleted with "KILL ???.fdb"

    I have tried

    'gfix -user SYSDBA -password masterkey dbserver:c:\mydb.fdb -shut full -force 0

    But the server does not release it right away, you always have to wait for an unspecified amount of time before it actually releases the file so it can be deleted with "Kill".
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    77
    Rep Power
    9
    I found the solution in case anybody else needs it. You have to execute the "drop database" with the connection object not the command object.

    Instead of

    ct.activeconnection = ConXOBJ
    ct.commandtext="drop database 'c:\test.fdb';"

    Use

    ConXOBJ.Execute ("drop database")

    Comments on this post

    • pabloj agrees : Thanks for posting the solution

IMN logo majestic logo threadwatch logo seochat tools logo