none
AccessDatabaseEngine: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. RRS feed

  • Frage

  • Hallo, habe folgendes Problem, weiß nicht ob es jetzt in dieses Forum oder ins Powershellforum besser passt.
    Habe recherchiert und nichts passendes gefunden:

    Habe ein PowershellSkript welches unter Windows XP Pro (V2002 SP3) unter MS-Excel2003 Professional problemlos funktioniert.
    Das Skript muss aber unter Windows Server 2008 R2 64-Bit (unter MS-Excel Pro Plus 2010 Version: 14.0.6023 32-Bit) laufen.

    Das Skript liest die Daten mittels OleDb aus einem Excel-file aus, und schreibt die Daten in eine SQL Server-Tabelle.

    Was unter WinXP ohne Probleme funktioniert, sieht unter Win2008 R2 so aus:
    ----------------------------------------------------------------------------------------------------------
    Exception calling "Open" with "0" argument(s): "The 'Microsoft.ACE.OLEDB.12.0'

    provider is not registered on the local machine."
    At D:\SQLImp.ps1:108 char:19
    +         $conn.open <<<< ()
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException

    Exception calling "Fill" with "1" argument(s): "The 'Microsoft.ACE.OLEDB.12.0'
    provider is not registered on the local machine."
    At D:\SQLImp.ps1:112 char:23
    +         [void]$da.fill <<<< ($dt)
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException

    ----------------------------------------------------------------------------------------------------------
    Habe auch schon die AccessDatabaseEngine auf dem Server installiert. (Die 32-Bit Version, da Office auch eine 32-Bit Version ist. (www.microsoft.com/de-de/download/details.aspx?id=13255))


    Ich verwende folgenden ConnecstionString  für WinXP/Excel2003 (Ohne Probleme):
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=`"$filepath`";Extended Properties=`"Excel 8.0;HDR=Yes;IMEX=1`";"

    für Win2008 R2:
    "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=`"$filepath`";Extended Properties=`"Excel 12.0 XML;HDR=Yes;IMEX=1`";"

    Kennt sich jemand aus damit?

    lg speedy

    Mittwoch, 27. Juni 2012 13:40

Antworten

Alle Antworten