Archive: How to attach mdf file into SQL Database


How to attach mdf file into SQL Database
Hi

I am trying to attach an MDF file to database after installing SQLEXPRESS.

Thanks in Advance


Using the MMSQL plugin you can use the sp_attch_db stored procedure
the line will be similar to
MSSQL_OLEDB::SQL_Execute /NOUNLOAD "sp_attach_db [$SQLDevice],[$INSTDIR\device.mdf],[$INSTDIR\device_log.LDF]"
where $SQLDevice is the name of the device to be attached and $INSTDIR is the dir where you extract the device from your setup script


Hi sgiusto

your script working on XP but my setup will crash on 2000 and it exist from setup.


The plugin needs the sql oledb client to be installed. It comes with XP with 2000 I think you have to install latest version of MDAC


Hi,
I investigated further the behaviour under win 2000.
There was a bug under dll initialization on win 2000.
I have fixed that.
You can download the new version of the plugin from the nsis site.
regards
Stefano


Thanks foryour reply.
Can you please send me the new link so that I can download the updated version.

Thanks


Hi sgiusto
I have downloaded the SQL Plugin from this Link.
http://nsis.sourceforge.net/MSSQL_OLEDB_plug-in
Is this link contain updated version.

Thanks


this is the url
nsis.sourceforge.net/MSSQL_OLEDB_plug-in
dll version is 1.1


Thanks a lot for your concern. I think the problem was in SQL plugin. Now it is working fine in Win 2000 also.
Thanks once again to you.