Crystal Reports XI - 查询中的语法错误在SQL Server中正常工作

时间:2017-05-12 15:11:09

标签: sql-server crystal-reports

我有一个查询,并且在SQL Server Management Studio(2008)中,它运行正常,但是当我使用动态参数查询相同查询时向报表添加子报表时,我得到两个错误。

我第一次在设置的默认值中设置的值,例如' A'被解释为列名并显示

  

列名A无效

当我发送一个常数' A'没有参数,没有显示错误。

这是我的代码:

select top 1 
    isnull( dtssegcabv.dscv_fecharecepcion, 0) as FechaRecepcion
from 
    CabVenta 
join 
    dtssegcabv on CabVenta.cvescv_id = dtssegcabv.scv_id
where 
    CabVenta.cve_letra = {?cve_letra} 
    and CabVenta.cve_codpvt = {?cve_codpvt} 
    and CabVenta.cve_nro = {?cve_nro} 
    and CabVenta.cvetco_cod = {?cvetco_cod}

如果我没有发送默认值(让对话框为空),则错误为

  

关键字和

附近的语法不正确

我再说一遍,SQL Server中的查询工作正常。数据类型均为varchar

感谢您的帮助,抱歉我的英语不好。

1 个答案:

答案 0 :(得分:0)

这是引用问题:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:iis="http://schemas.microsoft.com/wix/IIsExtension">
  <Product Id="*"
           Name="DealingWithThisWixBullshitInstaller"
           Language="1033"
           Version="1.0.0.0"
           Manufacturer="Derp"
           UpgradeCode="1408102b-2ffd-41ff-ad57-6319b7fbfa58">
    <Package InstallerVersion="200"
             Compressed="yes"
             InstallScope="perMachine"
             InstallPrivileges="elevated" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of this product is already installed." />
    <MediaTemplate />

    <Feature Id="ProductFeature"
             Title="DealingWithThisWixBullshitInstaller"
             Level="1">
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>

    <Property Id="WixShellExecTarget"
              Value="[#DealingWithThisWixBullshitExecutable]" />

    <CustomAction Id="LaunchApplication"
                  BinaryKey="WixCA"
                  DllEntry="WixShellExec"
                  Impersonate="yes" />
    <CustomAction Id="AddHttpsReservation"
                  Directory="INSTALLFOLDER"
                  ExeCommand="[SystemFolder]netsh http add urlacl url=https://127.0.0.1:9998/ sddl=D:(A;;GX;;;BU)"
                  Execute="deferred"
                  Impersonate="no"
                  Return="asyncWait" />
    <CustomAction Id="AddHttpsBinding"
                  Directory="INSTALLFOLDER"
                  ExeCommand="[SystemFolder]netsh http add sslcert ipport=0.0.0.0:9998 certhash=E68AA1985440FDAD0BB07547BE2C9957F416709B appid={8feef448-1a4f-408f-b6d4-8a90300517ed}"
                  Execute="deferred"
                  Impersonate="no"
                  Return="asyncWait" />
    <CustomAction Id="DeleteHttpsReservation"
                  Directory="INSTALLFOLDER"
                  ExeCommand="[SystemFolder]netsh http delete urlacl url=https://127.0.0.1:9998/"
                  Execute="deferred"
                  Impersonate="no"
                  Return="asyncWait" />
    <CustomAction Id="DeleteHttpsBinding"
                  Directory="INSTALLFOLDER"
                  ExeCommand="[SystemFolder]netsh http delete sslcert ipport=0.0.0.0:9998"
                  Execute="deferred"
                  Impersonate="no"
                  Return="asyncWait" />

    <InstallExecuteSequence>
      <Custom Action="LaunchApplication"
              After="InstallFinalize">NOT REMOVE~="ALL"</Custom>
      <Custom Action="AddHttpsBinding"
              Before="InstallFinalize">Not Installed</Custom>
      <Custom Action="AddHttpsReservation"
              Before="InstallFinalize">Not Installed</Custom>
      <Custom Action="DeleteHttpsReservation"
              After="InstallInitialize">REMOVE~="ALL"</Custom>
      <Custom Action="DeleteHttpsBinding"
              After="InstallInitialize">REMOVE~="ALL"</Custom>
    </InstallExecuteSequence>
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR"
               Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER"
                   Name="DealingWithThisWixBullshitInstaller" />
      </Directory>
      <Directory Id="ProgramMenuFolder">
        <Directory Id="ApplicationProgramsFolder"
                   Name="DealingWithThisWixBullshit"/>
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <DirectoryRef Id="ApplicationProgramsFolder">
      <Component Id="ApplicationShortcut"
                 Guid="*">
        <Shortcut Id="ApplicationStartMenuShortcut"
                  Name="DealingWithThisWixBullshit"
                  Description="Dealing with this wix bullshit"
                  Target="[#DealingWithThisWixBullshitExecutable]"
                  WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
        <RemoveFolder Id="CleanUpShortCut"
                      Directory="ApplicationProgramsFolder"
                      On="uninstall"/>
        <RegistryValue Root="HKCU"
                       Key="Software\Microsoft\DealingWithThisWixBullshit"
                       Name="installed"
                       Type="integer"
                       Value="1"
                       KeyPath="yes"/>
      </Component>
    </DirectoryRef>
  </Fragment>

  <Fragment>
    <Binary Id="CACert"
            SourceFile="muhfakecert.pfx"/>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents"
                    Directory="INSTALLFOLDER">
      <Component Id="ProductComponent">
        <File Id="DealingWithThisWixBullshitExecutable"
              Vital="yes"
              Source="$(var.DealingWithThisWixBullshit.TargetDir)DealingWithThisWixBullshit.exe"
              Checksum="yes" >
        </File>
        <File Id="readme"
              Source="$(var.DealingWithThisWixBullshit.TargetDir)readme.txt"
              Checksum="yes" >
        </File>
        <iis:Certificate Id="CACert"
                         Name="CACert"
                         Overwrite="yes"
                         StoreLocation="localMachine"
                         StoreName="my"
                         PFXPassword="I HATE YOUR FACE AND I HOPE YOU DIE!"
                         BinaryKey="CACert"/>
      </Component>
      <ComponentRef Id="ApplicationShortcut"/>
    </ComponentGroup>
  </Fragment>
</Wix>

完美地运作