Benutzer mit den meisten Antworten
AccessDatabaseEngine: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

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:
provider is not registered on the local machine."
----------------------------------------------------------------------------------------------------------
Exception calling "Open" with "0" argument(s): "The 'Microsoft.ACE.OLEDB.12.0'
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
Antworten
-
Hi,
schau mal hier: http://social.technet.microsoft.com/Forums/en-US/office2007deploymentcompatibility/thread/cc10d906-0fd8-49ef-a1b0-45814bd70c55/
Guido Over MCITP Server Administrator 2008 & MCSA Windows 2008
- Als Antwort markiert speedcar343 Donnerstag, 28. Juni 2012 11:32
Alle Antworten
-
Hi,
schau mal hier: http://social.technet.microsoft.com/Forums/en-US/office2007deploymentcompatibility/thread/cc10d906-0fd8-49ef-a1b0-45814bd70c55/
Guido Over MCITP Server Administrator 2008 & MCSA Windows 2008
- Als Antwort markiert speedcar343 Donnerstag, 28. Juni 2012 11:32
-
Dankeschön, bin drauf gekommen... Da der Server auf einer x64-Architektur läuft, führt die CMD-Prompt vom Server auch die Powershell im x64 Modus. Die Lösung hierfür ist also (und die bietet mir Win2008 R2 X64 gott sein dank an), die Powershell x86 zu verwenden (Mit der ACE 2007).
Der Aufruf von x86 Skripts auf x64 über command-prompt geht daher so: %WINDIR%\syswow64\windowspowershell\v1.0\powershell .\skript.ps1Danke Guido für den Hinweis, hat mir sehr geholfen!