Sub Update_User_List(strFile As String)
On Error GoTo Err_Update_User_List
' *=============================================================================================
' * Updates Users in a Namespace
' *=============================================================================================
Dim rstUsers As DAO.Recordset
Dim strUserProp As String
Dim I As Integer
Dim FileNum As Integer
Dim RecNum As Integer
Dim strFileName As String
Dim BatFile As String
' Put list of Users
Set rstUsers = CurrentDb.OpenRecordset("qselUsersToUpdate")
RecNum = 1
FileNum = 1
Do While RecNum <= rstUsers.RecordCount
I = 1
strFileName = strFile & FileNum & ".txt"
Open strFileName For Output As #1
Print #1, "//Updates Users in Namespace"
Do Until I > 150 Or rstUsers.EOF
strUserProp = "SetUserProperty, " & Q & rstUsers!User_Name & Sep
Print #1, "ChangeUserName, " & Q & rstUsers!S10_USERID & Sep & rstUsers!User_Name & Q
If Not IsNull(rstUsers!USER_DESC) Then
Print #1, strUserProp & "Description" & Sep & rstUsers!USER_DESC & Q
End If
If Not IsNull(rstUsers!USER_EMAIL) Then
Print #1, strUserProp & "Email" & Sep & rstUsers!USER_EMAIL & Q
End If
If Not IsNull(rstUsers!USER_FIRST) Then
Print #1, strUserProp & "FirstName" & Sep & rstUsers!USER_FIRST & Q
End If
If Not IsNull(rstUsers!USER_LAST) Then
Print #1, strUserProp & "LastName" & Sep & rstUsers!USER_LAST & Q
End If
If Not IsNull(rstUsers!USER_PHONE) Then
Print #1, strUserProp & "PhoneNumber" & Sep & rstUsers!USER_PHONE & Q
End If
Print #1, "SetUserFolder, " & Q & rstUsers!User_Name & Sep & rstUsers!FOLDER_NAME & Q
rstUsers.MoveNext
RecNum = RecNum + 1
I = I + 1
Loop
Close #1
BatFile = "C:\PROD\BatchFiles\7." & FileNum & "_UpdateUsers.bat"
Open BatFile For Output As #2
Print #2, "c:\progra~1\cognos~1\cer1\bin\AccessAdmMaint -namespace=default -uid=Administrator -pass=password -filetype=2 -filename=" & strFileName
Close #2
Print #99, StdLine & strFileName
FileNum = FileNum + 1
Loop
Exit_Update_User_List:
rstUsers.Close
Set rstUsers = Nothing
Close #1
Close #2
Close #3
DoCmd.SetWarnings True
Exit Sub
Err_Update_User_List:
MsgBox "Error #: " & Err & " " & Error & Chr(13) & "Error occurred during Update_User_List"
Resume Exit_Update_User_List
End Sub