Hi,
I have just wirtten/modified some code to check if a specified user is a member of a specified group, but when I run it I get the following error everytime, does anyone know how to stop this, I have tried logging out and loggin in and running the code before I do anything else.
"-2147467259 The database has been placed in a state by user 'system' on machine 'DESKTOP' that prevents it from being opened or locked."
Give me DAO I never had these problems with DAO!!
Thanks,
Gavin,
I have just wirtten/modified some code to check if a specified user is a member of a specified group, but when I run it I get the following error everytime, does anyone know how to stop this, I have tried logging out and loggin in and running the code before I do anything else.
"-2147467259 The database has been placed in a state by user 'system' on machine 'DESKTOP' that prevents it from being opened or locked."
Code:
Function ADOXgroup(strUserName As String, strGroup As String) As Boolean
Dim conn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim ConnStr As String
Dim MdwLocation As String
On Error GoTo Error
MdwLocation = "Jet OLEDB:System database=" & SysCmd(acSysCmdGetWorkgroupFile)
ConnStr = "data source=" & CurrentDb.Name & ";" & MdwLocation & ";user id=" & MdwUser & ";Password='" & MdwPwd & "'"
With conn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = ConnStr
.Open
End With
Set cat.ActiveConnection = conn
If cat.Users(strUserName).Groups(strGroup).Name Then ADOXgroup = True
Exit Function
Error:
MsgBox Err.Number & " " & Err.Description
Debug.Print Err.Number & " " & Err.Description
End Function
Give me DAO I never had these problems with DAO!!
Thanks,
Gavin,