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: Error with "Create Database If Absent" option for SQL Connection
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
‎Oct 21, 2011
04:23 PM
Error with "Create Database If Absent" option for SQL Connection
I have a SQL Connection with the option to "Create Catalog If Absent" checked.
The catalog does not exist.
When running the install, I use Windows Auth and/or SQL Auth and it fails with the error:
Error 27552. Error creating database ***. Server: Microsoft SQL Server (local). CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (1802).
I know the credentials are good, because if I choose a db catalog that exists, there is no error, no problem.
I cannot figure out a way around this.
The catalog does not exist.
When running the install, I use Windows Auth and/or SQL Auth and it fails with the error:
Error 27552. Error creating database ***. Server: Microsoft SQL Server (local). CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (1802).
I know the credentials are good, because if I choose a db catalog that exists, there is no error, no problem.
I cannot figure out a way around this.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 21, 2011
05:50 PM
Are you able to create a database on the server with the same login account from Microsof SQL Server Management Studio?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 21, 2011
09:02 PM
Yes, I can create a database with the same credentials in SSMS. I am logged in as the local machine admin, and I have logged into SSMS as the user "sa".
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 24, 2011
10:57 AM
I have seen this error before when I was building an installer with IS 2011 and 2012 both. I couldn't get rid of it.
The way I got around it was I unchecked the checkbox 'Create Database If Absent' in SQL Connection. Instead, I did following steps.
1. Check in InstallScript if SQL database already exists. If it does set a property.
2. Execute create database script only if this property is true.
Also, just for fun I wrote a C# class custom action that would execute a SQL script CreateDatabase(), if there's an exception, depending upon type of exception I would know if it was because the database already existed or because there were unattached mdf/ldf files with same name as the database being created. In later case, I would ask the user if they want to reattach the files to database or create a new one. If they chose to reattach, simply run a SQL script reattaching the files to the db, if they chose to create new db, rename the mdf/ldf.
Hope this info helps. Let me know if you have questions or need help with any of these options above.
The way I got around it was I unchecked the checkbox 'Create Database If Absent' in SQL Connection. Instead, I did following steps.
1. Check in InstallScript if SQL database already exists. If it does set a property.
2. Execute create database script only if this property is true.
Also, just for fun I wrote a C# class custom action that would execute a SQL script CreateDatabase(), if there's an exception, depending upon type of exception I would know if it was because the database already existed or because there were unattached mdf/ldf files with same name as the database being created. In later case, I would ask the user if they want to reattach the files to database or create a new one. If they chose to reattach, simply run a SQL script reattaching the files to the db, if they chose to create new db, rename the mdf/ldf.
Hope this info helps. Let me know if you have questions or need help with any of these options above.