Skip to content
⌘ NSIS Forum Archive

How to attach mdf file into SQL Database

9 posts

mukeshnaval#

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
sgiusto#
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
mukeshnaval#
Hi sgiusto

your script working on XP but my setup will crash on 2000 and it exist from setup.
sgiusto#
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
sgiusto#
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
mukeshnaval#
Thanks foryour reply.
Can you please send me the new link so that I can download the updated version.

Thanks
mukeshnaval#
Hi sgiusto
I have downloaded the SQL Plugin from this Link.

Is this link contain updated version.

Thanks
mukeshnaval#
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.