none
LocalDB problem - unable to connection via (LocalDB)\v11.0 but can via named paipes

    Question

  • I'm trying to use the WIX sql extension to create a database in a LOCALDB instance.

    It works when I use named pipes for the server instance but not when using the (LocalDB)\v11.0 format.

    I have reproduce the same problem outside of the WIX installer in a simple powershell script that uses the SMO objects.

    The environment has the .NET 4.0.2 update applied. The instance is running and accessible to Management Studio and the SQLLocalDB command line.

    I've created a shared instance and got the same results.

    Any other hints?

    Thanks

    Friday, March 30, 2012 10:24 AM

Answers

  • Wix appears to be using an old MDAC OLEDB driver which does not support LocalDB. Wix would have to move to the latest SNAC 11 OLEDB/ODBC driver to get LocalDB support.
    • Proposed as answer by Peja Tao Tuesday, April 10, 2012 2:19 AM
    • Marked as answer by MPEvans Wednesday, April 11, 2012 3:13 PM
    Friday, April 06, 2012 7:02 PM

All replies

  • I'm trying to use the WIX sql extension to create a database in a LOCALDB instance.

    It works when I use named pipes for the server instance but not when using the (LocalDB)\v11.0 format.

    I have reproduce the same problem outside of the WIX installer in a simple powershell script that uses the SMO objects.

    The environment has the .NET 4.0.2 update applied. The instance is running and accessible to Management Studio and the SQLLocalDB command line.

    I've created a shared instance and got the same results.

    Any other hints?

    Thanks

    which version of WIX are you using?

    does Wix Sql extension require .NET or is it unmanaged code ?

    Powershell is .NET 3.x and there will not use .NET 4.02 update and that's may be the reason why you can't use Powershell to access localdb.

    If you're using an .NET application to access the instance, configure it to use .NET 4.x runtime instead of .NET 2/3.5.

    Friday, March 30, 2012 3:12 PM
  • according to this read Powershell can communicate to LocalDB

    http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/fe176df3-6cae-4b56-b424-504c725ff3b2

    Therefore I would recommand to solve first the issue with Powershell connection to LocalDb. and if that had been solved switch to the problem with your Wix based installer.

    • Proposed as answer by Peja Tao Monday, April 02, 2012 3:31 AM
    Friday, March 30, 2012 3:16 PM
  • Daniel,

    I'm using WIX 3.6 and the extensions are C++ MSI custom actions with no need for .NET.

    Whilst 4.0.2 might well have enabled the LocalDB\v11.0 format for .NET, it doesn't seem true for the SMO and MSI custom actions!

    Thanks,

    Martin

    • Proposed as answer by Peja Tao Monday, April 02, 2012 3:31 AM
    • Unproposed as answer by Peja Tao Monday, April 02, 2012 3:31 AM
    Friday, March 30, 2012 4:31 PM
  • Hi MPEvans,

    I am stuck with the same problem.

    Can you give details on "It works when I use named pipes for the server instance"? What is the wix element and what is the "named pipe" representation you used for (LocalDB)\v11.0?

    Were you eventually able to solve or work around your problem?

    Thanks,

    Pavan


    Monday, April 02, 2012 4:16 AM
  • Pavan,

    My WIX XML as follows:

    <sql:SqlDatabase Id="EFT_Main_INT" Server="[DATABASE_SERVER]" Database="EFT" CreateOnInstall="yes" CreateOnReinstall="no" ConfirmOverwrite="yes" DropOnInstall="no" DropOnUninstall="no" ></sql:SqlDatabase>

    I'm passing the named pipes name for the LocalDB instance (http://msdn.microsoft.com/en-us/library/hh510202.aspx) into the [DATABASE_SERVER] property, but as this changes each time the instance stops and restarts, this is not really viable for an installer.

    Regards,

    Martin

    Monday, April 02, 2012 8:27 AM
  • Wix appears to be using an old MDAC OLEDB driver which does not support LocalDB. Wix would have to move to the latest SNAC 11 OLEDB/ODBC driver to get LocalDB support.
    • Proposed as answer by Peja Tao Tuesday, April 10, 2012 2:19 AM
    • Marked as answer by MPEvans Wednesday, April 11, 2012 3:13 PM
    Friday, April 06, 2012 7:02 PM
  • Brian,

    Thanks for your reply.

    I'll see what response I get on the WIX forums to this change!

    Regards,

    Martin

    Wednesday, April 11, 2012 3:14 PM
  • Brian,

      Any progress made on this issue?

    Monday, April 22, 2013 6:58 PM
  • Martin,

      any progress made on this issue?

    Monday, April 22, 2013 6:58 PM