This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: MDF file location
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 08, 2009
06:09 AM
MDF file location
I am includin g SQL Express 2005 in my setup package and specefying the MDF & LDF files locations in the SQL script but when running the project it still creating both files in the default SQL Server folder in the Program Files!! why?
this is the create part in SQL Script:
[PHP]/****** Object: Database the_internet_cafe Script Date: 03/11/2009 9:12:58 PM ******/
CREATE DATABASE [the_internet_cafe] ON (NAME = N'the_internet_cafe', FILENAME = N'C:\Program Files\Jassim Rahma\TICS\Database\the_internet_cafe.mdf' , SIZE = 3, FILEGROWTH = 1) LOG ON (NAME = N'the_internet_cafe_log', FILENAME = N'C:\Program Files\Jassim Rahma\TICS\Database\the_internet_cafe_log.LDF' , SIZE = 1, FILEGROWTH = 10%)
GO[/PHP]
this is the create part in SQL Script:
[PHP]/****** Object: Database the_internet_cafe Script Date: 03/11/2009 9:12:58 PM ******/
CREATE DATABASE [the_internet_cafe] ON (NAME = N'the_internet_cafe', FILENAME = N'C:\Program Files\Jassim Rahma\TICS\Database\the_internet_cafe.mdf' , SIZE = 3, FILEGROWTH = 1) LOG ON (NAME = N'the_internet_cafe_log', FILENAME = N'C:\Program Files\Jassim Rahma\TICS\Database\the_internet_cafe_log.LDF' , SIZE = 1, FILEGROWTH = 10%)
GO[/PHP]
(27) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 17, 2009
03:56 PM
Thank you for providing your project. I think that it is a permission issue of your custom database folder. If you change the Script Error Handling setting on the Runtime tab of your script files to "On Error, Abort Installation", I bet you will receive the "CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file '....mdf'. error.
If that is the case, you need to go to Microsoft SQL Server Configuration Manager and click on the Services node from the left pane. From the right pane select the SQL Server service that you target and go to its properties. Change the builtin login from 'Nerwork Service' to 'Local system' and restart the service.
Also, I would suggest that you move the first CREATE TABLE statement through the end of the file to the second script, so that they will run against the the_internet_cafe database, not master.
Hope that helps.
If that is the case, you need to go to Microsoft SQL Server Configuration Manager and click on the Services node from the left pane. From the right pane select the SQL Server service that you target and go to its properties. Change the builtin login from 'Nerwork Service' to 'Local system' and restart the service.
Also, I would suggest that you move the first CREATE TABLE statement through the end of the file to the second script, so that they will run against the the_internet_cafe database, not master.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 17, 2009
04:53 PM
hidenori wrote:
If that is the case, you need to go to Microsoft SQL Server Configuration Manager and click on the Services node from the left pane. From the right pane select the SQL Server service that you target and go to its properties. Change the builtin login from 'Nerwork Service' to 'Local system' and restart the service.
but i don't have a specefic server! I am installing the SQL Server Express 2005 included in my setup package so in every setup it will be a fresh installation? any way to grant the required previllages to the script?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 17, 2009
05:34 PM
You can change the logon service account during the Microsoft SQL Server 2005 Express installation. For silent installations, you can specify via the SQLACCOUNT command line parameter. Please check out How to: Install SQL Server 2005 from the Command Prompt for more details.
If you want to assign the Write permission to the folder for the Network Service account, you need to use the new Locked-Down Permission method introduced in InstallShield 2010. Please check out Securing Files, Folders, and Registry Keys in a Locked-Down Environment for more details.
Regards.
If you want to assign the Write permission to the folder for the Network Service account, you need to use the new Locked-Down Permission method introduced in InstallShield 2010. Please check out Securing Files, Folders, and Registry Keys in a Locked-Down Environment for more details.
Regards.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2009
07:41 AM
hidenori wrote:
Also, I would suggest that you move the first CREATE TABLE statement through the end of the file to the second script, so that they will run against the the_internet_cafe database, not master..
Thanks for your help.. I tried it on C:\TEMP and it worked so it's for sure a permission issue. I will check the SQLACCOUNT and let you know
but i didn't understand what do you mean byu the above about the CREATE TABLE..
Do you mean I keep the CREATE DATABASE in the first connection and the rest of the CREATE TABLEs in the second connection? so my frst connection will only have CREATE DATABASE? is that what you are trying to say?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2009
09:50 AM
jrahma wrote:
but i didn't understand what do you mean byu the above about the CREATE TABLE..
Do you mean I keep the CREATE DATABASE in the first connection and the rest of the CREATE TABLEs in the second connection? so my frst connection will only have CREATE DATABASE? is that what you are trying to say?
Yes, the script under the first connection will run against the master database, and the other script under the second connection will run against the the_internet_cafe database. Therefore, you need to move the line 64 through the end of the file in the first script to the second connection.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2009
04:40 PM
YAHOOOOO!!!!! 🙂
Finally working properly
can you please explain to me plz what did you do in your 1 to 13 steps so that I know what to do instead of just doing it like an idiot 😄
Thank you sooo much 🙂
Finally working properly
can you please explain to me plz what did you do in your 1 to 13 steps so that I know what to do instead of just doing it like an idiot 😄
Thank you sooo much 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 18, 2009
06:11 PM
I am glad that your issue has been solved!
What I suggested was to create two connections; the first one for connecting to the master database to run the script that will create and configure the the_internet_cafe database, and the second one for connecting to the the_internet_cafe database to run the rest of the script that will add items such as tables to the the_internet_cafe database.
Since the the_internet_cafe database does not exist when you click the Next button on the SQLLogin dialog, and both connections use the same login credentials but target a different database, I added a control event so that only the first connection will be validated by the action.
Regards.
What I suggested was to create two connections; the first one for connecting to the master database to run the script that will create and configure the the_internet_cafe database, and the second one for connecting to the the_internet_cafe database to run the rest of the script that will add items such as tables to the the_internet_cafe database.
Since the the_internet_cafe database does not exist when you click the Next button on the SQLLogin dialog, and both connections use the same login credentials but target a different database, I added a control event so that only the first connection will be validated by the action.
Regards.