BadgerByte
Well-known member
Hey all,
Currently deploying MSDE and have written an installer class, I intend to use sp_attach_db within the installer class to attach a database previously detached from my development system. I have all the code for using sp_attach_db, but have hit a brick wall!!
Does anyone know how on earth I would know where the mdf files are from the installer class? I have to pass the path to the stored procedure. I tried GetCurrentDirectory in the hope that it would return either the application directory or the deployment CD path but it returns the system32 directory. Has anyone done this before? if so any help would be marvellous.
I may even perform a remarkably sophisticated dance for you in compensation!
To summarise:
I have an installer class
On the AfterInstall event I'm trying to run sp_attach_db
I have everything else set up (Detecting service, starting service, instance etc)
I don't know where to put the mdf file or how to find them from the installer class.
Currently deploying MSDE and have written an installer class, I intend to use sp_attach_db within the installer class to attach a database previously detached from my development system. I have all the code for using sp_attach_db, but have hit a brick wall!!
Does anyone know how on earth I would know where the mdf files are from the installer class? I have to pass the path to the stored procedure. I tried GetCurrentDirectory in the hope that it would return either the application directory or the deployment CD path but it returns the system32 directory. Has anyone done this before? if so any help would be marvellous.
I may even perform a remarkably sophisticated dance for you in compensation!
To summarise:
I have an installer class
On the AfterInstall event I'm trying to run sp_attach_db
I have everything else set up (Detecting service, starting service, instance etc)
I don't know where to put the mdf file or how to find them from the installer class.