Форумы HiProg.com - MS ACCESS, VBA, VB

 

Ответить на сообщение

Вернуться к теме

Вы отвечаете на сообщение:

ник: Дядя Федор
щас попробую
неа.

ПЕРЕФОРМУЛИРУЮ ВОПРОС
как понизить безопасность аксес рантайм?

закрываю вопрос
Просто при установке рантайма не образуется strSecurity = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\security\Level"

создаем его и меняем скрипт

DIM AccessShell, strPathToAccess, strCurrentPath, WshShell, strSecurity,WshFldrs

Const OverwriteExisting = TRUE

'путь к мои документы

    Set WshShell = WScript.CreateObject("Wscript.Shell")
    ' Создаем объект WshSpecialFolders
    Set WshFldrs = WshShell.SpecialFolders
    strCurrentPath=WshFldrs("MyDocuments")


Set objFSO = CreateObject("Scripting.FileSystemObject")
'WScript.Echo "1 - " & strCurrentPath & " Турникет2011.mdb"

objFSO.CopyFile "F:\Отчеты\TURNIKET\Base\Турникет2011.mdb" ,strCurrentPath & "\" & "Turhiket.mdb"  , OverwriteExisting

If Err.Number Then
WScript.Echo "Ошибка копирования."
else
'WScript.Echo "Успех"
Err.Clear
End if

'Set AccessShell = CreateObject("Access.Application")
'strAccessVersion = AccessShell.SysCmd(7)
strSecurity = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\security\level"
Set WshShell = CreateObject("WScript.Shell")
' Понижаем безопасность
If WshShell.RegRead(strSecurity) <> 1 Then
    WshShell.RegWrite strSecurity, 1, "REG_DWORD"
End If
'strPathToAccess =  AccessShell.sysCmd(9)  & "MSACCESS.EXE "
'WScript.Echo strPathToAccess
strCurrentPath =strCurrentPath & "\" & "Turhiket.mdb"
'WScript.Echo strCurrentPath
'Set WshShell = CreateObject("WScript.Shell")
'Set AccessShell = WshShell.Exec(strPathToAccess & """" & strCurrentPath)

' Создаем объект WshShell
'Set WshShell = WScript.CreateObject("WScript.Shell")

'WScript.echo strPathToAccess & """" &  strCurrentPath
'WScript.echo "MSACCESS.EXE " & """" &  strCurrentPath
'Return = WshShell.Run(strPathToAccess  & " """ &  strCurrentPath & """", 1, true)
Return = WshShell.Run("MSACCESS.EXE " & """" &  strCurrentPath & """", 1, true)


ВСЕМ СПАСИБО!


Ваше имя:

Пароль:

Цитировать: [quote][/quote] Код: [code][/code]
Жирный: [b][/b] Наклонный: [i][/i]
URL: [url][/url] 

Сообщение:

 Размер файла не более 50 Кбт. Большие файлы можно размещать на www.slil.ru

Прикрепить:

 

Для вставки смайлов в текст щелкните по значку.