DLL permission check in vba

R

roland

Hi to all,

does anybody know how to check if the current windowsuser
have the rights for a (selfmade;) DLL

thanks for your help
roland
 
R

roland

in .net there is something like:

Option Explicit
Option Strict
Imports System
Imports System.IO
Imports System.Security
Imports System.Security.Permissions
Namespace OptimizedSecurity
Public Class FileUtil
Public Sub New()
End Sub
Public Sub GetFileCreationTime(Directory As String)
'Initialize DirectoryInfo object to the passed directory.
Dim DirFiles As New DirectoryInfo(Directory)
'Create a DateTime object to be initialized below.
Dim TheTime As DateTime
'Get a list of files for the current directory.
Dim Files As FileInfo() = DirFiles.GetFiles()
'Create a new instance of FileIOPermission with read
'permission to the current directory.
Dim FilePermission As New
FileIOPermission(FileIOPermissionAccess.Read, Directory)
Try
'Check the stack by making a demand.
FilePermission.Demand()
'If the demand succeeded, assert permission and
'perform the operation.
FilePermission.Assert()
Dim x As Integer
For x = 0 To Files.Length - 1
TheTime = File.GetCreationTime(Files(x).FullName)
Console.WriteLine("File: {0} Created: {1:G}", Files(x).Name,
TheTime)
Next x
'Catch a security exception and display an error.
Catch
Console.WriteLine("You do not have permission to read this
directory.")
End Try
End Sub
End Class
End Namespace

but i´m using office 2003 and access :(
 
Top