>Ok the backup works ! Thanks ! Now I am trying to do the restore but it tells me that the database is in use, so I tried an SQLDISCONNECT() then SQLEXEC() to run the restore but I know longer have a connection handle to send with the SQLEXEC(). Is there anyway to attach to the database without actually opening it ?
Add a "use master" line before the first line of your restore command, and don't disconnect. You can't restore a database while you're using it - so use master instead. It has to do some housekeeping (to register the restore, at least) anyway.