954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Login Privilages

Can any one tell me how can i make privileges for user to restrict them and only administrator have all rights.

Please help me
Thanks in advance.

Naveed_786
Posting Whiz in Training
268 posts since Jul 2010
Reputation Points: 20
Solved Threads: 11
 

Will this be an administrator within your application or the windows administrator?

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

within my application

Naveed_786
Posting Whiz in Training
268 posts since Jul 2010
Reputation Points: 20
Solved Threads: 11
 

Have a look at the following which was asked a few days ago on Daniweb.

http://www.daniweb.com/forums/thread323025.html

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Ok can you provide me sample coding for login a user by checking user exists in users table i have tried but no luck

i am trying some thing like this

dim db as database
dim rs as recordset


on form load i am connecting with database like this
my connecting string here and
set rs = db.openrecordset("Users")

Then i used this coding on btnlogin

select query here

but i didn't successed i please help me waiting for you reply

Naveed_786
Posting Whiz in Training
268 posts since Jul 2010
Reputation Points: 20
Solved Threads: 11
 

Try the following -

Dim cnPrint As ADODB.Connection
    Set cnPrint = New ADODB.Connection
 
    Dim rsPrint As ADODB.Recordset
    Set rsPrint = New ADODB.Recordset
    Dim MyCon As String
 
    MyCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\MyData.MDB;Persist Security Info=False"
 
    cnPrint.Open MyCon
 
    If rsPrint.State = adStateOpen Then rsPrint.Close
 
    rsPrint.Open "SELECT * FROM MyTable WHERE UserType =" & "'" & text1.Text & "'", cnPrint, adOpenStatic, adLockOptemistic

    'Or

    rsPrint.Open "SELECT * FROM MyTable WHERE UserYesNo =" & "'Yes'", cnPrint, adOpenStatic, adLockOptemistic
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Put all of the above code under ONE event, say a button click event.

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

Ok i would try and let you know if could have any problem thanksfor your reply

Naveed_786
Posting Whiz in Training
268 posts since Jul 2010
Reputation Points: 20
Solved Threads: 11
 

No problem:)

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

I have resolved it thanks for yuor help

Naveed_786
Posting Whiz in Training
268 posts since Jul 2010
Reputation Points: 20
Solved Threads: 11
 

Its a pleasure.:)

AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You