can anyone pls help me with this.. ngtry pu kz q gumawa kaso di xa nagteterminate ih.. di xa ngloloop hanggang maging 3 ung Counter.. pahelp nman pu...(T-T) e2 ung codes q:
Private Sub Command1_Click()
Dim Counter As Integer
If txtUserName = x Then
Call PasswordOption
Else
MsgBox "Access Denied!"
txtUserName.SetFocus
Counter = Counter + 1
SendKeys "{Home}+{End}"
End If
If Counter = 3 Then
MsgBox "You reached the maximum attempts allowed to log in. System is now terminating.."
End
End If
End Sub
Private Sub PasswordOption()
If txtPassword = y Then
MsgBox "Welcome! Login succeded!"
Else
MsgBox "Access denied!"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
Counter = Counter + 1
If Counter = 3 Then
MsgBox "System will now terminate!", , "MIS"
End
End If
End If
End Sub
Private Sub Form_Load()
Counter = 0
End Sub
PS: im just a newbie so pls explain to me ur suggestion in a way that a beginner will understand..
thanks pu sa mga mag-aaksaya ng oras 2mulong sken... heheh..
dito nalang ako compile huh kasi wala me sa pc ko hehehe try mo to
'declare it globally
Dim rs as ADODB.Recordset
Dim Counter as Integer
'sa form load
Private Sub Form_Load()
Call connection
counter = 0
End Sub
'assume that eto ay command for login
'place the code below (command1)
Set rs = New ADODB.Recordset
'condition for counter if counter = 3 then end the program or validate the user
If counter = 3 then end
With rs
.Open "Select * from administrator WHERE username = '" & txtUserName.Text & "' and password = '" & txtPassword.Text & "' ", conn, adOpenStatic, adLockOptimistic
If .EOF Then
'txtUserName.Text = ""
txtPassword.Text = ""
txtPassword.SetFocus
MsgBox "Invalid Username & Password!", vbExclamation, "User Authentication"
'set counter ++
counter = counter + 1
Else
'Unload Me
'show form here for admin
MsgBox "Correct Username & Password!", vbInformation, "User Authentication"
txtUserName.Text = ""
txtPassword.Text = ""
txtUserName.SetFocus
End If
End With
sana makatolong hehehe :)
undying_emolove@yahoo.com
kuya thanks pu.... :) ttry q 2.. mdali nga xa intindihin.. :) kso me d aq alam d2,.. ung ADODB.. bhala n, heheh.. i guess i'll just have to study more.. heheh..
thanks pu ulet... :) muahz.. :)
yap madali lang intindihin ado hehehe kaso focus nako sa ado.net kasi vb.net nako hehehe goodluck pohj!tsup :)
Dudes alam mo ba kung pano ung pag nag fail ng 3 times sa log in lock na ung buong system?
Ung iba kse pag nag fail ng 3 times pwede ulit i-run. Ang nsa isip ko pag nag fail ng 3 times lock na ung system ndi na pwede i-run. At syempre pano din ung pag unlock nya hehehe.
Web / System Developer
Contacts :
09327081978
recca_flame05@yahoo.com >>> Facebook/YM
ICCT Colleges Cainta Rizal
dapat lock lang ung account kasi pag lock ung buong system edi damay ung ibang account na hindi naman nakapag 3 attempts.
tama ung sinabi ni C_SharpShooter maglagay k lng ng additional column mu sa user table let say "Attempt" n nandun ung maximum attempt ng every user at every failed log in babawasan mu xa.tapos che2ck mu din xa every log in pra malaman mu kung lock n ung account nya. cmpre you need to put another module na mag aunlock nung mga na lock n account and that is for admin rights only.
I want to do this because of too many people who want to hack some of my system. I mean this is requested by my client so I have to do it.
I'm not talking about DTR thing which only one employee will be lock.
What I mean is the whole thing like the log in of admin and failing then lock the whole system.
This is for the safety of my client's system ok?
Web / System Developer
Contacts :
09327081978
recca_flame05@yahoo.com >>> Facebook/YM
ICCT Colleges Cainta Rizal
What type of system ba ito?
Maraming klase para ilock ang system kung gusto mong wag ng gumana...
Then unlocking mechanism mo kung gusto mong online unlocking or via user license, system update, etc...
DTR(including payroll)+Inventory+Information only.
Of course kung mala-lock ung system I also need the solution pra ma-unlock. ^_^
Hindi ko kse close ung nakita kong may ari ng system na may lock e kya hindi ko natanong.
Web / System Developer
Contacts :
09327081978
recca_flame05@yahoo.com >>> Facebook/YM
ICCT Colleges Cainta Rizal
Choices mo for locking..
* via file (remove a dll, create a dummy file, checksum, etc.)
* registry
* ini file
* database locking
To unlock the system, eto lang mechanism mo
* real-time updates
* fix-tools
* system upgrade
I got an idea, you mentioned the database.
Well i'll just lock the database (not the whole program) just in case there is someone who will manipulate it using vb. And also i'll put password on the database.
Thank you very much ^_^
Web / System Developer
Contacts :
09327081978
recca_flame05@yahoo.com >>> Facebook/YM
ICCT Colleges Cainta Rizal
kuya how can u lock the database?
may ginawa ako dati na ganyan finake ko lng gumawa ako ng isang label na not visible
as my counter para sa mga msgbox ko try mo po to
Dim ctr As Integer
Private Sub CMDOK_Click()
With adoUser.Recordset
.MoveFirst
While Not .EOF
If txtuser.Text = "" Or txtpass.Text = "" Then
MsgBox "The system requires Username and Password." + vbCrLf + "Fill up all entries!", vbInformation, "MsgBox"
txtuser.SetFocus
Exit Sub
Else
If ctr < 2 Then
If txtuser.Text = .Fields(0) Then
If txtpass.Text = .Fields(1) Then
frmmainmenu.Show
Unload Me
Exit Sub
Else
GoTo X:
End If
Else
GoTo X:
End If
Else
MsgBox "You have reached your Maximum Log In Attempt for this session." + vbCrLf + "The Program will Exit now!", vbInformation, "ADMINISTRATOR"
End
End If
End If
X:
.MoveNext
Wend
txtuser.SetFocus
End With
ctr = ctr + 1
Label3.Caption = Val(Label3.Caption) - 1
If Label3.Caption > 1 Then
MsgBox "Invalid Entry, Check USERNAME and PASSWORD! You Only Have " & Label3 & " Tries Remaining Before The Program Exits.", vbInformation, "ADMINISTRATOR"
Else
MsgBox "Invalid Entry, Check USERNAME and PASSWORD! You Only Have " & Label3 & " Try Remaining Before The Program Exits.", vbInformation, "ADMINISTRATOR"
End If
End Sub
need code for the 3 time per day log in max.
Option Explicit
Public LoginSucceeded As Boolean
Dim bytretries As Byte
Private Sub cmdCancel_Click()
'set the global var to false
'to denote a failed login
LoginSucceeded = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'On Error Resume Next
Dim SQL, path As String
path = App.path
With ADO
.CommandType = adCmdText
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & path & "\Employee.mdb;Persist Security Info=False"
.RecordSource = "Select * from Users"
.Refresh
.Recordset.MoveFirst
Do Until .Recordset.EOF
If (LCase$(.Recordset.Fields("Password")) = LCase$(txtPassword.Text)) And (LCase$(.Recordset.Fields("Username")) = LCase$(txtUserName.Text)) Then
MsgBox "A C C E S S G R A N T E D !!"
Me.Hide
Load frmMain
frmMain.Show
Exit Sub
Else
.Recordset.MoveNext
End If
Loop
txtUserName.Text = ""
txtPassword.Text = ""
MsgBox "A C C E S S D E N I E D !!", vbExclamation + vbOKOnly, ""
txtUserName.SetFocus
' SendKeys "{Home}+{End}"
'---------------------------------------------
'after 3 retries, quit
If bytretries = 2 Then
MsgBox "Guessing is not allowed!!", vbCritical, " - Security"
End
Else
bytretries = bytretries + 1
End If
End With
End Sub
emond sabiniano
System Developer-Software Consultant
waaaahh!!!! SQL!! *panick* heheh.. i really appreciate ur kindness sir but i still dont know how to deal with SQL.. heheh..
but really, thanks a lot.... :) muah!! ^.^
Additional lang:
Kung 3 trials lang then locked na yung account nya,
need to put a status sa users_table na nalock na yung account nya....
(kung 3 attempts per day trial, etc )
Dapat yung login process mo before at hand ay nagchecheck na kung locked yung account
gusto q nga rin pu sna ganun kso hirap ee.. dq kaya, heheh.. yan nga n mas simple hirap nq eh.. heheh.. pro thanks nrin pu s suggestion.. :)
Kunin mo yung bigay nila sayo...
Dagdag requirements lang naman yung inadvise ko...
May update procedure/statement ka lang na isasama pag nakatatlo na sya...
ttry q plng pu kng mggwa q ung bigay nila, heheh.. im really having a hard time w/ this..
pro pag ngwa q da2gdgan q tlga un.. :) thanks ulet.. :)
3 trials per day? set kalang ng time nyan hehehe use timer :)
Additional lang:
Kung 3 trials lang then locked na yung account nya,
need to put a status sa users_table na nalock na yung account nya....
(kung 3 attempts per day trial, etc )
Dapat yung login process mo before at hand ay nagchecheck na kung locked yung account
sir naggawa poh ako ng report sa ginawa kong system kaso ang problema ko eh nd xa lagi automatic path
sir pls help me namn poh
gawin mo na lang configurable....
Use ODBC connection...
Magpalipat lipat man ang apps mo (locally or remotely)
doon mo lang iseset ulit...
'declair first lahat ng connection mo
Dim dbLogin As New ADODB.Connection
Dim rsLogin As New ADODB.Recordset
Dim ctr As Byte
Private Sub cmdLogin_Click()
OpenConn dbLogin, rsLogin, "SELECT * FROM tblUsers WHERE UserName='" & txtUser.Text & "' AND PassWord='" & txtPass.Text & "'"
With rsLogin
If .EOF = True Then
MsgBox "Incorrect username or password.", vbCritical
ctr = ctr + 1
txtUser.Text = ""
txtPass.Text = ""
txtUser.SetFocus
Else
MsgBox "Welcome", vbInformation
Form1.Show
Unload Me
End If
End With
exitSub:
CloseConn rsLogin, dbLogin
If ctr = 3 Then
MsgBox "You have attempted to login three (3) times. Program will now close.", vbInformation
End
End If
End Sub
It works fine with my system hopefully it will give you an idea ^_^
Web / System Developer
Contacts :
09327081978
recca_flame05@yahoo.com >>> Facebook/YM
ICCT Colleges Cainta Rizal
sales and inventory system of an ice cream business,. yan poh ang naassign smin,. bka meon poh s inyo ang nkpaggwa n ng ganun,. pahelp nmn poh,. ok kung my idea poh kau,.
..hirap kc eh,. lalo n ung part ng inventory,. d koh lam kung panoh ipapakita/ilalagay s dbase ung stocks nung products,. ..tapos kung pano babawas ng automatic sa stocks kapag nakabenta,.
..sounds easy peo d nmin magawa,.
..kc nmn e2 ung line up ng products huh,.
..may fields n,. products, flavors, quantity, amount/price,.
..kunyari, product=cream cup, flavors=chocolate, ube, vanilla, cheese,. quantity=100,. price=15.00
..naguguluhan kmi, kc daming flavors,...
,.basta gnun,. help nmn.,
anyone help me in my program........? how to make a log in with 3 attempts
Private Sub Command1_Click()
Dim Counter As Integer
If txtUserName = x Then
Call PasswordOption
Else
MsgBox "Access Denied!"
txtUserName.SetFocus
Counter = Counter + 1
SendKeys "{Home}+{End}"
End If
If Counter = 3 Then
'gwa k ng lblcounter den add mu tong code na..newbie din aq, but try mu qng mkakatulong..
lblcounter.text=counter
MsgBox "You reached the maximum attempts allowed to log in. System is now terminating.."
End
End If
End Sub
Private Sub PasswordOption()
If txtPassword = y Then
MsgBox "Welcome! Login succeded!"
Else
MsgBox "Access denied!"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
Counter = Counter + 1
If Counter = 3 Then
MsgBox "System will now terminate!", , "MIS"
End
End If
End If
End Sub
Private Sub Form_Load()
Counter = 0
End Sub
if you need more explanation or help..contact me.bga makatulong aq sau khit papanu..hehe..cutelilpaul_10@yahoo.com
'ok lng ung code mu..triny q.but my pnalitan aqng konte.d q kc alm qng para sn ung x and y..d xa nadiclare qng string o integer..try mu lng to..bka mktulong khit ppnu..hehehehehhehehe..vb.net
Public Class Form1
Dim Counter As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If txtUserName.Text = "x" Then
Call PasswordOption()
Else
MsgBox("Access Denied!")
txtUserName.Focus()
Counter = Counter + 1
' SendKeys("{Home}+{End}")
End If
If Counter = 3 Then
MsgBox("You reached the maximum attempts allowed to log in. System is now terminating..")
End
End If
End Sub
Private Sub PasswordOption()
If txtPassword.Text = "y" Then
MsgBox("Welcome! Login succeded!")
Else
MsgBox("Access denied!")
txtPassword.Focus()
' SendKeys("{Home}+{End}")
Counter = Counter + 1
If Counter = 3 Then
MsgBox("System will now terminate!", , "MIS")
End
End If
End If
End Sub
Private Sub Form_Load()
Counter = 0
End Sub
End Class
'ok lng ung code mu..triny q.but my pnalitan aqng konte.d q kc alm qng para sn ung x and y..d xa nadiclare qng string o integer..try mu lng to..bka mktulong khit ppnu..hehehehehhehehe..vb.net
Public Class Form1
Dim Counter As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If txtUserName.Text = "x" Then
Call PasswordOption()
Else
MsgBox("Access Denied!")
txtUserName.Focus()
Counter = Counter + 1
' SendKeys("{Home}+{End}")
'End If (Dapat itong end if nato wala dito banda.. nasa next na para maka continue 'xang mag loop)
If Counter = 3 Then
MsgBox("You reached the maximum attempts allowed to log in. System
is now terminating..")
End
End If
End if
End Sub
Private Sub PasswordOption()
If txtPassword.Text = "y" Then
MsgBox("Welcome! Login succeded!")
Else
MsgBox("Access denied!")
txtPassword.Focus()
' SendKeys("{Home}+{End}")
Counter = Counter + 1
If Counter = 3 Then
MsgBox("System will now terminate!", , "MIS")
End
End If
End If
End Sub
Private Sub Form_Load()
Counter = 0
End Sub
End Class
i need a code in my program in ASP.Net.. a login form with 3trials.. please help me.. ^_^ tnx and God Bless
anime
Pages
Add new comment