With respect to SQL errors, another good approach is to run a profiler session 
on the server in question, capturing everything related to activity - session 
login, failures especially, but also SQL statement completion.  Best to do this 
at a reasonably idle period of course so as not to bury your profile.

When run the install.  Look carefully at the events and see if you see the 
login - that will show you failure or success, and in failure you can usually 
see why, e.g. an unexpected account for example.  Or conversely you can confirm 
you got logged in, and see the statement(s) that it tried to execute to create 
the database and which succeeded or failed.  Translation of things like paths 
can be seen (depending on exactly how you do it) in the TextData portion, so 
you can see if the create statement came through as expected.

I've often found this better than the logs (though similar in many ways) as the 
logs often do not show success, so when you get a simple "failure" without any 
good rationale, it is hard in the logs to see how far your statement got, but 
profile will show you the progress and the actual T-SQL running.

Note for SQL Express you may need to fiddle around with the configuration to 
make sure you can connect profiler to it, but if you have SSMS already 
connecting you are likely good.

-----Original Message-----
From: Michael Osmond [mailto:mosm...@baytech.com.au] 
Sent: Monday, September 12, 2011 7:56 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Wix CreateDatabase failure to connect to remote SQL 
Server Express 2005

Hi Rob

My experience Error 0x80004005 will be an access denied type error.  Check the 
SQL Management Logs for the SQL instance to see what the error is.   Possible 
issues:

* It could be logon (description below on how to diagnose a logon error)
* It could be be privilege.
* It could be you are setting a path to the MDF / LDF files that the SQL 
Service does not have access to.

To check the 2nd and 3rd errors, run the equivalent create database command 
from a remote tool, using the appropriate logon and see what error you get

Logon Error:

If the server encounters an error that prevents a login from succeeding, the 
client will display the following error mesage. 

To determine the true reason for the failure, the administrator can look in the 
server's error log where a corresponding entry will be written. 

An example of an entry is: 

2006-02-27 00:02:00.34 Logon     Error: 18456, Severity: 14, State: 8.
2006-02-27 00:02:00.34 Logon     Login failed for user '<user name>'. [CLIENT: 
<ip address>]
The key to the message is the 'State' which the server will accurately set to 
reflect the source of the problem. In the example above, State 8 indicates that 
the authentication failed because the user provided an incorrect password. The 
common error states and their descriptions are provided in the following table: 

ERROR STATE     ERROR DESCRIPTION
2 and 5        Invalid userid
6              Attempt to use a Windows login name with SQL Authentication
7              Login disabled and password mismatch
8               Password mismatch
9               Invalid password
11 and 12      Valid login but server access failure
13             SQL Server service paused
18             Change password required

State 16 = Does not have access to database. 

Regards

Michael



-----Original Message-----
From: Rob Harrison [mailto:rharri...@volumatic.com]
Sent: Monday, 12 September 2011 8:28 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Wix CreateDatabase failure to connect to remote SQL Server 
Express 2005

Hi,

Using the Wix 3.5 release, the attached Wix project fails to create a database 
on the remote SQL Server Express 2005 machine using SQL authentication. The 
following error is reported in the MSI log snippet:

------ MSI log ----------------------------------------------------
MSI (s) (E8:08) [11:03:50:456]: Executing op:
ActionStart(Name=CreateDatabase,Description=Creating Databases,) MSI (s) 
(E8:08) [11:03:50:456]: Executing op:
CustomActionSchedule(Action=CreateDatabase,ActionType=25601,Source=Binar
yData,Target=**********,CustomActionData=**********)
MSI (s) (E8:58) [11:03:50:467]: Invoking remote custom action. DLL:
C:\WINDOWS\Installer\MSI395.tmp, Entrypoint: CreateDatabase
CreateDatabase:  Error 0x80004005: failed to create to database:
'TestDb', error: unknown error

Error 26201. Error -2147467259: failed to create SQL database: TestDb, error 
detail: unknown error.
MSI (s) (E8:58) [11:04:09:043]: Product: TestCreateDb -- Error 26201.
Error -2147467259: failed to create SQL database: TestDb, error detail:
unknown error.

Action ended 11:04:09: InstallFinalize. Return value 3.
------ MSI log ----------------------------------------------------
 
My remote server (named Win7-64) is a Windows 7 64-bit machine with SQL server 
installed and configured to allow remote access via port TCP/IP 1433. I can 
connect to SQL Server and create the database remotely using other mechanisms 
including Management Studio Express and a native C++ test project using SQL 
Native Client ADO.

I've even managed to embed a custom Vbscript action into the Wix script that 
will create the database remotely via ADO using Sql Auth, however it seems more 
correct to use the in-built SqlDatabase Wix elements.

Can anyone help? Suggestions appreciated, Rob.

------- Product.wxs ------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
     xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension";
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension";>
  
        <Product Id="d7acc7da-b4d7-4678-8381-27c798d6b8fd" 
           Name="TestCreateDb" 
           Language="1033" 
           Version="1.0.0.0" 
           Manufacturer="TestCreateDb" 
           UpgradeCode="1aff6a39-41bc-4d67-ae36-faf528bd8b7b">
    
                <Package InstallerVersion="300" Compressed="yes" />

                <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

    <util:User Id="SqlUser"
               Name="sa"
               Password="some-password" />                
    
                <Directory Id="TARGETDIR" Name="SourceDir">
                        <Directory Id="ProgramFilesFolder">
                                <Directory Id="INSTALLLOCATION"
Name="TestCreateDb">

          <Component Id="TestDbCreate"
                     Guid="D94463D3-4220-4037-8E6C-78572741A247">

            <File Id="FileTxt"
                  Source="file.txt" />
            
            <sql:SqlDatabase Id="TestDb"
                             Database="TestDb"
                             User="SqlUser"
                             Server="Win7-64"
                             CreateOnInstall="yes"
                             DropOnUninstall="yes">
              
            </sql:SqlDatabase>
            
          </Component>
          
                                </Directory>
                        </Directory>
                </Directory>

                <Feature Id="ProductFeature" Title="TestCreateDb"
Level="1">
      <ComponentRef Id="TestDbCreate" />
                </Feature>
        </Product>
</Wix>
------- Product.wxs ------------------------------------------------
********************************************************

The information transmitted is intended only for the person or entity to which 
it is addressed and may contain confidential and/or privileged material. If you 
are not the addressee, any disclosure, reproduction, copying, distribution, or 
other dissemination or use of this communication is strictly prohibited. If you 
have received this transmission in error please notify the sender immediately 
and then delete this e-mail.
E-mail transmission cannot be guaranteed to be secure or error free as 
information could be intercepted, corrupted lost, destroyed, arrive late or 
incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions in 
the contents of this message which arise as a result of e-mail transmission. If 
verification is required please request a hard copy version.

********************************************************


------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop What are the key 
obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable 
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA Learn about the 
latest advances in developing for the BlackBerry&reg; mobile platform with 
sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to