Reputation: 1 Apprentice
- New Members
- Active Posts:
- 12 (0.02 per day)
- 12-July 12
- Profile Views:
- Last Active:
- Feb 24 2013 10:58 PM
- Dream Kudos:
Posts I've Made
Posted 1 Feb 2013
Posted 31 Jan 2013It appears you have not initialized the conn object. Not a great mystery use the New keyword like it states in the error.
Dim co As New ClassObject 'example of initialization.
This is a fundamental knowledge point for all your future works, please get a book and learn the basics - it will serve you well.
THANK YOU SIR! I did it! I did it! I did it! Hooray! Thank you again! =D
Posted 29 Jan 2013Remove the Try..Catch block to allow any error message(s) to be shown then let us know the error message(s) you receive.
Sir! there is an error at
IF .State = ConnectionState.Open Then .Close()
`It says that NullExceptionRefrenceUnhandled
Object refrence not set to an instance of an object.
Use the "new" keyword to create an object instance.
Check to determine if the object is null before calling the method.
Get general help for this exception.
and so on. .
#Region "Connection" Sub ConntoDB() Try With conn If .State = ConnectionState.Open Then .Close() .ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=votersAccounts.accdb" .Open() End With Finally End Try End Sub #End Region
Sir! please help me! =((
Posted 29 Jan 2013
Posted 28 Jan 2013For general practice in security it is best never to tell the user if it was their username or password that is wrong. This is because if someone is attacking the login and you are saying the username is incorrect a bunch of times and then suddenly tell the user that password is incorrect the attacker now knows a valid username to attack.
Always use the line Your username and/or password is incorrect, please try again. That way the attacker never really knows if either of them is actually valid.
Also the code you are presenting there is done in VB6 old syntax and is not how it is done anymore in VB.NET. For instance MsgBox should now be MessageBox.Show("message")
So if you put this together you should have something like...
Dim count as integer = 0 If count < 3 then If userTextbox.text = "username" and passTextbox.text = "password" then MessageBox.Show("Welcome!") Else MessageBox.Show("Your username and/or password is incorrect. Please try again.") count += 1 End if Else MessageBox.Show("You have been banned for 3 minutes.") ' Start timer if it hasn't been started, otherwise leave event ' At end of timer, reset count back to 0 End if
This code above assumes you have it tied into a login button event some how. />
Thank you very much for your helpful tips and a very quick response. . . Good day! =DThe reason your original code wasn't working is because If..ElseIf requires ElseIf to be one word.
Yes! that is also my code error. . thank you! =D
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
- Click here to e-mail me
jonbon004 hasn't added any friends yet.