0

hello frnz...How to code for a login form by taking data from Oracle db?
M having a table Employee having attribute as emplogin and emppwd...from there i want to check that whether the user has entered the correct data or not...
I mean i want to match the entered data with that of the data in database.
Plz help me out with this...as m new to VB6.

This is a simple coding when the id and pswd is USER

Private Sub cmdlogin_Click()
If txtlogin.Text = "user" And txtpwd.Text = "user" Then
frmprjlist.show
Unload Me
Else
MsgBox ("Login Failed! Try Again....")
Me.Refresh
End If

End Sub


Thanx in advance...

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by era_chatterbox
0

Yo need to use COUNT function in oracle by passing the username and password from frontend. If this returns 1 then only allow to login else re-prompt for correct username and password.

0

Hi,

You need an ADO Connection object and a Recordset object .
First open the Connection to the Oracle database.
and open a Recordset with this Query:
"Select * From Login_Info_Table Where UserName = '" & txtUser.Text & "'" And Pwd = "'" & txtPwd.Text & "'"

If the above query returns any Records, then you allow the user to login..

Regards
Veena

0

Yo need to use COUNT function in oracle by passing the username and password from frontend. If this returns 1 then only allow to login else re-prompt for correct username and password.

I use this function and here is the code..
i knw, m wrong.
will u plz help me out

If Adodc1.Recordset.RecordCount <> 0 Then
'Adodc1.Recordset.MoveLast
'Adodc1.Recordset.MoveFirst
'Adodc1.RecordSource = "select emplogin, emppwd from employee"
'Adodc1.Recordset.Find "Empid='" & Trim(txtlogin.Text) & "'" ??????

'End If

waiting 4 ur reply
Era

0

Hi,

You need an ADO Connection object and a Recordset object .
First open the Connection to the Oracle database.
and open a Recordset with this Query:
"Select * From Login_Info_Table Where UserName = '" & txtUser.Text & "'" And Pwd = "'" & txtPwd.Text & "'"

If the above query returns any Records, then you allow the user to login..

Regards
Veena

h'lo veena

i followed the instruction given by u
bt again i think..m wrong somewhere as i hv include few codes by myself
here is the code

'If Adodc1.Recordset.RecordCount <> 0 Then
'Adodc1.Recordset.MoveLast
'Adodc1.Recordset.MoveFirst
Adodc1.RecordSource = "select * from employee where Emplogin = '" & txtlogin.Text & "'" And Emppwd = "'" & txtpwd.Text & "'"
'Else
'MsgBox ("Login Failed! Try Again....")
'Me.Refresh
'End If

Plz do suggest me...where m wrong...;) :P

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.