views:

188

answers:

1

I want to restore a database backup existing beside the application in setup time.

I have custom action and in the install method need to restore the database with the backup file.

When I use SQL Server 2008 Express edition I got error.

please help me.

A: 
  • preferably use attach / detach... restore is problematic under certain circumstances, especially running fully automatic.

  • OSQL (the command) may be your friend ;)

  • Why restore? Why not use the automount feature? Just asking ;)

TomTom
thank you for your answerbecause there are some data that should be exist on the database for primitive actions like login with admin user and etc ...plus i dont know how i can atach data base programitically in the custom actions
ARamin
You can run any script from a custom action, and attaching / detaching is a normal SQL command which you can submit using OSQL. But still, I wuold use automount with a prepared empty database.
TomTom