Function ToggleReadOnly()
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(c:\DB1)
If f.attributes and 1 Then
f.attributes = f.attributes - 1
ToggleReadOnly = "Databases are Read/Write."
Else
f.attributes = f.attributes + 1
ToggleReadOnly = "Databases are Read Only."
End If
End Function
Function DBS_ReadOnly()
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("H:\TEST\db1.accdb")
f.Attributes = 1
Set f = Nothing
Set f = fso.GetFile("H:\TEST\db2.accdb ")
f.Attributes = 1
Set fso = Nothing
End Function
Function DBS_ReadWrite()
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("H:\TEST\db1.accdb")
f.Attributes = 0
Set f = Nothing
Set f = fso.GetFile("H:\TEST\db2.accdb ")
f.Attributes = 0
Set f = Nothing
Set fso = Nothing
End Function
attrib +r H:\TEST\db*.accdb