none
powershell conexao com oracle RRS feed

  • Pergunta

  • Boa Tarde Pessoal

    Estou tentando fazer uma conexao com banco oracle via powershell, da uma olhada aonde estou tomando erro, alguem ja passou por isso ?

    $AssemblyFile = "C:\oracle\product\10.2.0\BIN\Oracle.DataAccess.dll"
    $ConnectionString = "User ID=usuario;Password=senha;Data Source=banco;Persist Security Info=True"
    $CommandText = "SELECT count(*) FROM tabela"
    [Reflection.Assembly]::LoadFile($AssemblyFile) | Out-Null
    $OracleConnection = New-Object -TypeName Oracle.DataAccess.Client.OracleConnection
    New-Object : Exception calling ".ctor" with "0" argument(s): "An attempt was made to load a program with an incorrect 
    format. (Exception from HRESULT: 0x8007000B)"
    At line:1 char:21
    + $OracleConnection = New-Object -TypeName Oracle.DataAccess.Client.OracleConnecti ...
    +                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
        + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

    terça-feira, 17 de março de 2015 19:59