syntax problem!help wanted!

Hi,
I have two databases db1 and db2.

I am trying to restore these databases to backups using c++ app.
The app checks if db2 backup file is present or not. DB2 restore is attempted automatically if someone tries to restore db1. (it is jsut like that)

if the user does not have backup file for db2 then i try to restore db2 to backup file of db1 using following sql

"RESTORE DATABASE DB2 FROM DISK = 'c:\Program Files\Microsoft SQL Server\MSSQL\Backup\DB1.Backup.dat' With Move 'DB1Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\DB2Data.mdf', 'DB1Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\DB2Data.mdf', REPLACE"

when i try to execute hte sql server gives a syntax error
and I have consulyt4ed books and stuff but did not see nay problems.
can anyone help me?
thanks
[901 byte] By [venAdder] at [2007-11-19 2:49:57]
# 1 Re: syntax problem!help wanted!
And what is the error? Please specify.

U have 4 sure 1 problem with that SQL...
U specify DB1Data and DB1Log to be the same file "DB2Data.mdf".
Copy/paste problem?
:)

Best regards,
Krzemo.
Krzemo at 2007-11-9 13:39:13 >
# 2 Re: syntax problem!help wanted!
yeah copy paste problem!

found out only after posting

thnks for help though!!
venAdder at 2007-11-9 13:40:12 >