Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Wix创建DSN_Wix_Odbc_Dsn - Fatal编程技术网

使用Wix创建DSN

使用Wix创建DSN,wix,odbc,dsn,Wix,Odbc,Dsn,无法通过Wix创建系统DSN 这是我的测试代码 <?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="TestProduct" Language="1033" Version="0.0.0.1" Manufacturer="WixEdit" UpgradeCode="*">

无法通过Wix创建系统DSN

这是我的测试代码

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="TestProduct" Language="1033" Version="0.0.0.1" Manufacturer="WixEdit" UpgradeCode="*">
        <Package Description="Test file in a Product" Comments="Simple test" InstallerVersion="200" Compressed="yes" />
        <Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Component Id="C_PROD_DSN" Guid="*">
                <ODBCDataSource Id="Prod_Dsn" Name="SomeName" Registration="machine" DriverName="ODBC Driver 11 for SQL Server">
                    <Property Id="Description" Value="Some Description" />
                    <Property Id="Database" Value="SomeDB" />
                    <Property Id="Language" Value="us_english" />
                    <Property Id="LastUser" Value="SomeUser" />
                    <Property Id="Driver" Value="C:\windows\system32\msodbcsql11.dll" />
                </ODBCDataSource>
            </Component>
        </Directory>
        <Feature Id="DefaultFeature" Title="Main Feature" Level="1">
            <ComponentRef Id="C_PROD_DSN" />
        </Feature>
        <UI />
    </Product>
</Wix>

Wix-Edit编译得很好,但是当我运行它时

配置ODBC数据源时出错:SomeName。ODBC错误6:在注册表中找不到组件。验证文件SomeName是否存在,以及您是否可以访问它

这是SQL DB的DSN,而不是文件的DSN

我知道我可以通过建立我需要的注册表树来实现这一点,我只是想尝试使用任务的内置功能

这可以使用ODBCDataSource完成吗?(如果没有自定义操作,我现在就没有时间再写一个)或者我应该减少损失,用RegistryKey和RegistryValue来完成吗