Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I tell if a user is revising the database?

Status
Not open for further replies.

joanl

Technical User
Apr 10, 2001
20
US
Greetings from the dark side, ::)

I am maintaining a database and need to know if or how I can tell a user (who has full Access) is changing forms, or code, etc. It appears that someone else is revising designs, sort orders, etc. Since these other folks aren't authorized to do changes, is there a way to track down whoever is doing this ? Any suggestions are greatly appreciated.
 
i had a similiar problem, except i was gettnig accused of chaning things and of course it couldnt be the user ;-)

so i set up a history table and on certaIN parts of the database i have the following sort of code , the function for WHOAMI and the DLL are at the bottom, the dll call needs to go at the top of the moduke


Private Sub Combo216_AfterUpdate()
Dim Mydb As Database
Dim MyreC As Recordset

Set Mydb = CurrentDb()
Set MyreC = Mydb.OpenRecordset("SELECT * FROM tblhistory")


With MyreC
.AddNew
![CptyID] = Me.Text189.Value
![CprtyName] = Me.Text187.Value
![OriginalStatusValue] = GetStatInTxt(StrOrig)
![NewStatusValue] = GetStatInTxt(Me.Combo216.Value)
![DateofChange] = Date
![ChangedBy] = WhoAmI
.Update
End With

Set Mydb = Nothing
Set MyreC = Nothing

StrOrig = Me.Combo216.Value

Me.tblhistory_subform.Form.Requery
End Sub



Public Function WhoAmI() As String
Dim lngret As Long
Dim lpBuffer As String
Dim nSize As Long
lpBuffer = String$(255, 0)
nSize = Len(lpBuffer)
lngret = GetUserName(lpBuffer, nSize)
If lngret = 0 Then
lpBuffer = String$(nSize, 0)
lngret = GetUserName(lpBuffer, nSize)
End If
WhoAmI = left(lpBuffer, nSize - 1)
End Function


Public StrOrig As Integer
Private Const SW_MINIMIZE = 6
Private Const SW_HIDE = 0
Private Const SW_NORMAL = 1
Private Const SW_MAXIMIZE = 3
Private Const ERROR_SUCCESS = 0

Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, _
nSize As Long) As Long
Private Declare Function ShowWindow Lib "user32" _
(ByVal hWnd As Long, ByVal nCmdShow As Long) As Long


 
Have you activated the security module?

Have you assigned appropriate groups?

Have you assigned users to the appropriate groups?

If all of the above are Yes, the ONLY properly authorized users are modifying the design of objects.

Otherwise, go back to the beginning all over again. Implement Security.

On a different approach, Is the database "Split"? With the tables only in one .MDB and the Code / Forms / Reports in another?

If this (second approach) is true, there are some ways to deal w/ the issue.

The first would be to make the "front end" a .MDE file (pseudo compiled). NO one can alter the design of the objects.

The second would be to set up a number of db's with the "front end" objects.

A "Design Master", only on YOUR system, and maintained as PRIVATE to you.

A "User Master", A network share read only version - use this (as explained later) to update Users versions.

Numerous "User Slave" versions. Each User would have their own private copy of the "front end objects" db. They would be free to add/delete/modify objects within this db as desired.

A "Design Slave" mdb. This would be another network "share" db. It would be used to "collect" user additions and changes to their private (User Slave) dbs for review and possible inclusion in the master. It would also allow YOU to see who is making the changes).

The basic operation of these dbs is:

You maintain the "Design Master". All "official" objects are resident here. In general, you would make changes in a copy of this db, test the changes and get approval from the user community and / or your supervisor using the informal copy. Once a change was approved, it would be copied to the "Design Master". You would -generally- copy the design master to the "User Master" only after sending notice to the User community of the impending changes.

In the "Front End", there would be a routine in the startup object. This code would check it's 'Status' (usually only the path for the db) to determine if it were NOT the "User Master" or the "Design Master", it would compare its' object list to the " User Master" object list. For ANY/ALL objects which were "newer" in the " User Master" than the copy, the routine would delete the (local) copy and copy the (Master) object from the " User Master". It would also copy any objects which exist in the local db but not in the " User Master" to the "Design Slave", with the "UserName" Pre-pended to the Object name.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top