1

我已经构建了一个在 BIDS 中运行良好的 SSIS 包。包运行成功。

我现在尝试从命令行执行相同的包,使用相同的配置,但它无法获取连接(错误 0xC0208452:DTS_E_ADODESTFAILEDTOACQUIRECONNECTION)。

失败的连接是与包含所有失败的访问文件的 ADO.Net 连接(正如我所说,直接在 BIDS 中,它可以工作)。

我使用以下命令行(在 .cmd 文件中)。X86 标志设置为我还使用到 Excel 文件的连接:

@echo off
set dtexec=%programfiles%\Microsoft SQL Server\100\DTS\Binn\dtexec.exe
"%dtexec%" /X86 /f "myPackage.dtsx" 

输出是:

Error: 2011-12-05 09:47:38.94
   Code: 0xC0208452
   Source: Output Errors to access file [162]
   Description: ADO NET Destination has failed to acquire the connection {19CC1EA2-BD93-4006-919E-39A80E828BB1}. The connection may have been corrupted.
End Error

用于此连接的连接字符串是:

Data Source=c:\path\to\errors.mdb;Provider=Microsoft.Jet.OLEDB.4.0

因此应用了共享连接的默认模式(16:ShareDenyNode)。

最后,我的平台是:

  • W2K8 R2 x64
  • SQL 2K8 R2 x64

我看不出这个命令行有什么问题。我会很感激一些帮助。

PS:以防万一,我尝试以管理员身份运行,但行为是相同的。

[编辑]不知道它是否有帮助,但这是使用 /ConsoleLog 标志时的错误日志:

Log:
     Name: Diagnostic
     Computer: mycomputer
     Operator: domain\me
     Source Name: Jet Errors
     Source GUID: {19CC1EA2-BD93-4006-919E-39A80E828BB1}
     Execution GUID: {90BCE5BA-CF8B-49FC-8275-1F1FF70720CB}
     Message: ExternalRequest_pre: The object is ready to make the following external request: 'IDbConnection.Open(ConnectionType: System.Data.OleDb.OleDbConnection,
 System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
ConnectionString: Data Source="c:\Path\to\errors.mdb";Provider=Microsoft.Jet.OLEDB.4.0;)'.
     Start Time: 2011-12-05 09:58:57
     End Time: 2011-12-05 09:58:57
End Log
Log:
     Name: Diagnostic
     Computer: mycomputer
     Operator: domain\me
     Source Name: Jet Errors
     Source GUID: {19CC1EA2-BD93-4006-919E-39A80E828BB1}
     Execution GUID: {90BCE5BA-CF8B-49FC-8275-1F1FF70720CB}
     Message: ExternalRequest_post: 'IDbConnection.Open failed'. The external request has completed.
     Start Time: 2011-12-05 09:58:57
     End Time: 2011-12-05 09:58:57
End Log
Log:
     Name: OnError
     Computer: mycomputer
     Operator: domain\me
     Source Name: Categories
     Source GUID: {6DD5D6E3-2256-43D5-84B8-E9C27E02694B}
     Execution GUID: {90BCE5BA-CF8B-49FC-8275-1F1FF70720CB}
     Message: ADO NET Destination has failed to acquire the connection {19CC1EA2-BD93-4006-919E-39A80E828BB1}. The connection may have been corrupted.

     Start Time: 2011-12-05 09:58:57
     End Time: 2011-12-05 09:58:57
End Log
Error: 2011-12-05 09:58:57.62
   Code: 0xC0208452
   Source: Categories To Categories Errors [162]
   Description: ADO NET Destination has failed to acquire the connection {19CC1EA2-BD93-4006-919E-39A80E828BB1}. The connection may have been corrupted.
End Error
Log:
     Name: OnError
     Computer: mycomputer
     Operator: domain\me
     Source Name: Categories
     Source GUID: {6DD5D6E3-2256-43D5-84B8-E9C27E02694B}
     Execution GUID: {90BCE5BA-CF8B-49FC-8275-1F1FF70720CB}
     Message: component "To Categories Errors" (162) failed validation and returned error code 0xC0208452.

     Start Time: 2011-12-05 09:58:57
     End Time: 2011-12-05 09:58:57
End Log
Error: 2011-12-05 09:58:57.64
   Code: 0xC0047017
   Source: Categories SSIS.Pipeline
   Description: component "To Categories Errors" (162) failed validation and returned error code 0xC0208452.
End Error

这是 dtsx 文件本身的连接定义:

<DTS:ConnectionManager>
    <DTS:Property DTS:Name="DelayValidation">0</DTS:Property>
    <DTS:Property DTS:Name="ObjectName">Jet Errors</DTS:Property>
    <DTS:Property DTS:Name="DTSID">{19CC1EA2-BD93-4006-919E-39A80E828BB1}</DTS:Property>
    <DTS:Property DTS:Name="Description"></DTS:Property>
    <DTS:Property DTS:Name="CreationName">ADO.NET:System.Data.OleDb.OleDbConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</DTS:Property>
    <DTS:ObjectData>
        <DTS:ConnectionManager>
            <DTS:Property DTS:Name="Retain">0</DTS:Property>
            <DTS:Password DTS:Name="Password" Sensitive="1" Encrypted="1">AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAeUySei4110aSwp/Lg9Ry2wAAAAAIAAAARABUAFMAAAADZgAAwAAAABAAAABIrrL+3ppbrbI4ELkWjVMvAAAAAASAAACgAAAAEAAAAMgk6OFh+lWGPpsFZ0dK9k8IAAAA1HCWmIm7dIsUAAAAjjx5q2XUdjp2o+FxWAaPCEgv94M</DTS:Password>
            <DTS:Property DTS:Name="ConnectionString">Data Source=c:\Path\To\errors.mdb;Provider=Microsoft.Jet.OLEDB.4.0;</DTS:Property>
        </DTS:ConnectionManager>
    </DTS:ObjectData>
</DTS:ConnectionManager>
4

1 回答 1

1

有些人在这个微软论坛帖子上给了我答案。

即使我设置了 X86 标志,我也必须使用 32 位版本的 DTEXEC 而不是 64 位版本。

我的批处理文件现在是:

@echo off
set dtexec=%programfiles(x86)%\Microsoft SQL Server\100\DTS\Binn\dtexec.exe
"%dtexec%" /X86 /f "myPackage.dtsx" 

并且正在工作...

于 2011-12-05T10:45:51.450 回答