Veränderung eines Registra-Eintrags in HKEY_LOCAL_MACHINE
hochlenert
Gesendet: 24.11.18 06:20
Betreff: RE: Veränderung eines Registra-Eintrags in HKEY_LOCAL_MACHINE


Member

Beiträge: 46
25
Hallo SKS,

wie Du geschrieben hast, löst das schreiben in die registry einen Fehler aus:
-2147024891 Ungültige Wurzel in Registrierungsschlüssel "HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\12.0\Access Connectivity Engine\Engines\ACE\MaxLocksPerFile".
Das hört sich nicht an wie "Dir fehlen Rechte", aber Fehlermeldungen haben ja solche Diskrepanzen an sich.

Also ist das automatisierte hochsetzen der maxlockfiles nicht möglich - oder doch? Bin etwas ratlos. Das ist mein aktueller code:

Public Function maxlockfileshoch()
On Error Resume Next
Dim WSHShell As Object
Dim testkey As String
Dim i As Long
Set WSHShell = CreateObject("WScript.Shell")
For i = 1 To 6
If i = 1 Then testkey = "HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\12.0\Access Connectivity Engine\Engines\ACE\MaxLocksPerFile"
If i = 2 Then testkey = "HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\14.0\Access Connectivity Engine\Engines\ACE\MaxLocksPerFile"
If i = 3 Then testkey = "HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\12.0\Access Connectivity Engine\Engines\Jet 3.x\MaxLocksPerFile"
If i = 4 Then testkey = "HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\14.0\Access Connectivity Engine\Engines\Jet 3.x\MaxLocksPerFile"
If i = 5 Then testkey = "HKLM\SOFTWARE\WOW6432Node\Microsoft\Jet\4.0\Engines\Jet 3.x\MaxLocksPerFile"
If i = 6 Then testkey = "HKLM\SOFTWARE\WOW6432Node\Microsoft\Jet\4.0\Engines\Jet 4.0\MaxLocksPerFile"

If WSHShell.regread(testkey) Then
Debug.Print testkey
WSHShell.RegWrite testkey, 95002, "REG_DWORD"
If Err <> 0 Then Debug.Print Err & Error$: Err = 0
Else
Err = 0
End If
Next i

End Function
Top of the page Bottom of the page