1 Replies - 794 Views - Last Post: 06 March 2018 - 12:08 AM Rate Topic: -----

#1 Rey Jan   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-March 18

How to show data in database using login button

Posted 05 March 2018 - 09:56 PM

Here is my code for login but when i'm going to login the data in database couldn't show. I mean I have two forms which is the Login form that has a two text boxes for Username and Password and two command button for Login and Logout and Another form for Grading report. What I'm trying to ask is how to connect username and password then after you click login the data in database will show through your username and password that I'm putting in Login Form which will show the Form2 (Grading Report) that will show the data in database.

Private Sub cmdCancel_Click()
SecurityLogforStudent.Hide
Form1.Show
End Sub

Private Sub cmdLogin_Click()
Adodc1.RecordSource = "select distinct Uname,Password from Students where Uname='" + txtUser.Text + "' and Password='" + txtPass.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.EOF Then
MsgBox "Login failed, Try Again...!!!", vbCritical, "Please Input correct Username and Password"


Else

MsgBox "Login Successful.", vbInformation, "Successful Attempt"

Mine.Show

SecurityLogforStudent.Hide
txtUser.Text = ""
txtPass.Text = ""
End If
End Sub


Private Sub Form_Load()

End Sub

This post has been edited by andrewsw: 06 March 2018 - 12:08 AM
Reason for edit:: added missing [code][/code] tags


Is This A Good Question/Topic? 0
  • +

Replies To: How to show data in database using login button

#2 andrewsw   User is online

  • quantum multiprover
  • member icon

Reputation: 6778
  • View blog
  • Posts: 27,966
  • Joined: 12-December 12

Re: How to show data in database using login button

Posted 06 March 2018 - 12:08 AM

What happens when you run your code? Are there errors?

What is your question?

Please wrap your code in code tags, I have added them for you this time.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1