> > 「もし,VBならこうする・・・.」という意見でも結構ですので
一応、レジストリを直接書きかえる方法を 書いておきます。
Option Explicit
Private Declare Function RegOpenKey& Lib "advapi32.dll" Alias "RegOpenKeyA" ( _ ByVal hKey As Long, _ ByVal lpSubKey As String, _ phkResult As Long _ )
Private Declare Function RegSetValueEx& Lib "advapi32.dll" Alias "RegSetValueExA" ( _ ByVal hKey As Long, _ ByVal lpValueName As String, _ ByVal Reserved As Long, _ ByVal dwType As Long, _ lpData As Any, _ ByVal cbData As Long _ )
Private Const HKEY_LOCAL_MACHINE = &H80000002 Private Const REG_SZ = 1
Private Sub Command1_Click() Dim hKey As Long Dim strSubKey As String Call RegOpenKey&(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Access\7.0\Jet\3.0\Engines\Jet", hKey) Call RegSetValueEx&(hKey, "SystemDB", 0, REG_SZ, ByVal "C:\MSOffice\Access\system.mdw", Len("C:\MSOffice\Access\system.mdw")) End Sub
|