PDA

Click to See Complete Forum and Search --> : Creating tables with users with their own prperties


michelle
May 8th, 2000, 08:05 PM
Dear VB users,

I want to create a database with many tables.
Not all users of the database may have access to a table or can only read the records. (no editing)
Is it possible to create a database in VB with Users? Every users gets their own password with properties.

if yes, can someone give me source how to create this.
Is it possible to create, when the database is made, to create new users?

Any information is welcome.


Source:

Set Db = Ws.CreateDatabase(DbSettings, dbLangGeneral)
Set tdfNew = Db.CreateTableDef("Vendor")
With tdfNew
.Fields.Append .CreateField("VendorName", dbText)
.Fields.Append .CreateField("VendorDate", dbDate)
End With
Db.TableDefs.Append tdfNew
Db.Close


Nice regards,

Michelle.

bruiserbruce
May 9th, 2000, 10:21 AM
Why not use ADOX. Books online has a copy of the Office 2000 Programmers Guide.

paddlefoot
May 9th, 2000, 12:24 PM
Here is one way you could accomplish this:

Store in a binary file, the user's login id's and
passwords. New users could be set up by a system
administrator procedure. Also, store a table in
your database wich login_id's and access levels.
each time you open a database or write to a database,
lookup the users access level in the table and make
sure they have the correct permissions. For this to
work, the first thing that would need to be done when
your program starts is get the users login_id and password.
validate this with the password in the binary file. Once
the user has access, maintain a global variable that
contains the users login_id. Now each time the user adds,
updates, or deletes a record, you could check before this
in the login_id/access level table to make sure the
user has access to add, delete, or whatever. Your access
levels could be just numbers that the programer uses
to determine whether to let the user perform the following
action. At my company we have 1-9 access levels. 1 being
the lowest (view recs only) and 9 being the highest(add,update,delete,delete tables,db's ect..). This is just
an approach that you could take.

Hope this helps,


paddlefoot

michelle
May 9th, 2000, 02:02 PM
Hello paddlefoot & bruiserbruce,

Thanks for your information.

Michelle.