这样很好,试试看:
l_sRestore="Restore database db"+is_zt+ls_jznd+" from disk='"+ls_bckpath+"' "+&
"WITH MOVE 'dbmis_Data' TO '"+ls_datapath+"hr01"+ls_jznd+".mdf',MOVE 'dbmis_log' TO '"+ls_datapath+"hr01"+ls_jznd+"_log.ldf',replace"
//MessageBox('',l_srestore)
execute immediate :l_sRestore;
if SQLCA.SqlCode<>0 then
MessageBox('错误提示','恢复出错,原因:'+SQLCA.SqlErrText,stopsign!)
Goto Flag
End if