InstallShield 2012 Spring includes support for running SQL scripts on Microsoft SQL Server 2012 database servers. The SQLBrowse run-time dialog that is displayed when end users choose to browse for a database server can now list instances of SQL Server 2012 and SQL Server 2012 Express including SQL Server 2012 Express LocalDB. Created for developers, LocalDB is a new version of SQL Server Express that is more suitable for embedding, and it helps them avoid a full installation of other editions of SQL Server.
Although the SQLLogin run-time dialog can connect to an instance of SQL Server 2012 or regular SQL Server 2012 Express by default when end users click the Next button, it fails to connect to an instance of LocalDB. This is because installations that are created in InstallShield use the SQL Server OLE DB provider by default to connect to a SQL Server database, and that old provider does not understand LocalDB connection strings: “Data Source=(localdb)v11.0;Integrated Security=true…..”
In order to enable connecting to LocalDB, you must switch to use the SQL Server 2012 Native Client OLE DB provider by following the steps below:
- Open your InstallShield installation project.
- In the View List under Additional Tools, open the Direct Editor.
- In the Tables explorer, click the ISSQLDBMetaData table.
- Find the MSSQLServer record.
- The default value of the AdoDriverName field is “sqloledb”. Change it to the following value: “sqlncli11”
- Rebuild your installation.
The SQL Server 2012 Native Client OLE DB provider may not be installed on target systems. Therefore, you may want to use the Redistributables view to add the InstallShield prerequisite for the SQL Server 2012 Native Client to your installation in order to ensure that connecting to SQL Server works properly.
Note that InstallShield 2012 Spring does not include support for installing LocalDB named instances. If you want to create or delete named instances of LocalDB on target systems, consider using the SqlLocalDB Utility or writing your own code that calls the LocalDB Instance APIs.
The following example creates an instance of LocalDB named SampleInstance and starts the instance:
SqlLocalDB.exe create “SampleInstance” -s
To learn more about the new features in InstallShield 2012 Spring, click here:What’s New in InstallShield 2012 Spring.