Hi,
I try to make a task for backup/restore MS SQL databases via OSQL.EXE.
Both of them have the same structure (and a common base class, handles
OSQL.EXE)The backup works fine, but I have a problem with restore. I get
the name of the backup file from a property. When I try to restore, Ant
(I think) DELELTES the backup file, and OSQL can't find it. But if the
name of the backup file is in the Java code, then it works! The
generated command line is the same, and the code is very similar:
querystring = new StringBuffer("RESTORE DATABASE " + "news" + " FROM DISK=3D'" + getBackupPath() + "'");
querystring = new StringBuffer("RESTORE DATABASE news FROM DISK=3D'C:\\work\\ant\\news2.bak'");
I set the property backupfile to C:\work\ant\news.bak.
The first deletes the backupfile, but the second restores the database,
from the file news2.bak. Do you have any idea why does it happen?
Thanks in advance,
Don
