December 13, 2004 at 9:06 am
We are producing an InstallShield package to deliver software and a startup SQL Server database. We have produce a full backup of the startup database that we wish to install and have then coded ADO code in InstallShield to restore the database. It appears to correctly restore the database file (s) but leaves the database as 'Loading'.
If I replicate the code in VB/ADO I get the same problem, the VB is 'trivial' it just executes a SQL statement as 'sa' user on the master database against the connection object, the SQL it executes is
RESTORE DATABASE [DatabaseName]
FROM DISK = N'BackupFile' WITH FILE = 1, NOUNLOAD , RECOVERY ,
MOVE N'File_dat' TO N'DataFilename',
MOVE N'File_log' TO N'LogFilename'
If executes in Query Analyser this works correctly.
I have read that it is 'better' to use SQLDMO to do this kind of thing and in VB it certainly is, but we have already got InstallShield using ADO and don;t know whether it will be difficult to get it to use SQLDMO and in any case why should ADO not be able to execute any SQL statement ?
December 13, 2004 at 12:11 pm
I think that your command encounters a time-out error. You should try to increase the CommandTimeout parameter.
Razvan
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply