Exclusive Access Problem

I

illini_99

I am trying to make my database customize itself for individual users. I am
trying to make it so that the icon used for each user is custom to each user.
In my autoexec macro, I am executing the following function. For some
reason, this causes the database to not have exclusive access. If I open the
database holding the left shift key and bypassing the autoexec, everything is
fine. Help!

Function InitializeAppToUser() As Boolean
Const sROUTINE_NAME As String = "InitializeAppToUser"
On Error GoTo InitializeAppToUser_err:
InitializeAppToUser = False
Dim lsusername As String
Dim ls_UserIcon As String
Dim intX As Integer
Const DB_Text As Long = 10

lsusername = Environ$("username")
If Not GetUsersIcon(lsusername, ls_UserIcon) Then
End If

intX = AddAppProperty("AppIcon", DB_Text, ls_UserIcon)
CurrentDb.Properties("UseAppIconForFrmRpt") = 1
Application.RefreshTitleBar


InitializeAppToUser_Exit:

InitializeAppToUser = True
Exit Function

InitializeAppToUser_err:
InitializeAppToUser = False
Call MsgBox(Err.Description, , "Error")

End Function
 
I

illini_99

Please disregard my question. I figured out my problem. I love using ADODB
and I create module level connection to the Currentdb, so that I could use
ADODB to manipulate the current database using ADODB. My function that gets
the users' icon uses ADODB and initializes the connection and leaves it open.
This causes it to think other users are connected.

Does anyone else use ADODB against the current database and have any
recommendations? I used to be a VB programmer and loved ADODB. Now I am no
longer an IT guy, so...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top