AR Users Database ActiveX Library 1.20

This library will carry the management of an users database for login verification, and all the normal operations that you will need. All the information is stored in an encrypted file.

I'm sorry that there are a couple of members in the library whose names are in Spanish. Well, I'm Spanish and I cannot avoid writing things in Spanish while I'm programing, although I try to make everything in the libraries that I'm planing to export in English. For your information, Nombre means Name, and Apellidos means Last Name (or Surname). If you find anything else in Spanish, please tell me.

To use the library, among other things you will have to provide a password to encrypt all the information that is stored there. DON'T LOOSE THAT PASSWORD. This library doesn't have a master password or anything, so if you cannot access the information stored in the file, me neither.

If you have any questions, doubts, comments or bugs, please contact me.


  1. Added the ChangeRights function.
  2. Corrected a couple of minor bugs.
  3. Added the possibility of opening the database even when it is damaged (a wrong password is being used or someone has being modifying the database externally).
  4. Added the DamagedDB property.



In the ZIP file you will find the following files:

Put all those files together wherever you want. The .DEP file has the dependency information, that you will need if you want to create the installation of a program that uses my library.

ARRandomPwdGen.exe is a program that will generate random passwords of any length. You can use it to generate random passwords for the library. Of course, it also needs the Visual Basic 5 SP3 run-time libraries.





  1. UserID as String. The ID that the user will have in the system. It must be unique, so two users cannot have the same ID. The maximum length is 15 characters.

  2. Password. The password that the user will have. The maximum length is 15 characters.

  3. Level. 1 to 4, indicating the level of rights that the user has.

  4. Name (optional). User's first name. The maximum length is 15 characters.

  5. LastName (optional). User's last name. The maximum length is 35 characters.

  6. Admin (optional). True or False, depending on if this user has Administrator rights or not. Default is False.

This function will return True if successful or False if it fails for some reason. Look at the LastError property to get a description of the error.



This is an example on how to use the library:

Dim UsDB As New ARUsersDB
UsDB.Password = Password
UsDB.File = App.Path & "\Users.dat"
If UsDB.LastError <> "" Then

    MsgBox UsDB.LastError
End If

Dim bRes As Boolean
bRes = UsDB.AddUser(UserID, UserPassword, Level1, "Alvaro", "Redondo", True)
If Not bRes Then _

    MsgBox "There has been an error when trying to add this user to the database: " & UsDB.LastError

Dim bRes As Boolean
bRes = UsDB.DeleteUser(UserID)
If Not bRes Then _

    MsgBox "There has been an error when trying to delete this user from the database: " & UsDB.LastError

Dim bRes As Boolean
bRes = UsDB.VrfyUser(UserID, Password)
If Not bRes Then

    MsgBox "The identification is incorrect."


    MsgBox "Access granted."

End If

Print UsDB.ListUsers (UserID).Nombre

Tip: If you want to add an user with an empty password, so the user will have to add his / her password in the next logon, use some string and identify it as an empty string. For example, the empty string could be something like: "emptyemptyempty". When you add an user without a password, put that string as the password. Whenever an user introduces his / her identification without password, verify the account using that string. Also, make sure you don't allow that string to be used as a normal password. The library will not accept blank passwords for security reasons.


(33 Kb)


Alvaro Redondo, 1998. All Rights Reserved.