TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tunde Mattieu
NA
3
9.7k
Creating a login Form
Aug 4 2012 4:22 PM
Im trying to create a login form but i do not really understand where i am not getting it. Can anyone please look through my code and tell me where i am making a mistake.Below is my code.
Imports System.Data.OleDb
Public Class Form1
Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\HP\Documents\regData.accdb")
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
con.Open()
Dim cmd As New OleDbCommand("SELECT from regData WHERE username = '" & txtUsername.Text & "' and pswrd = '" & txtPasswrd.Text & "'", con)
Dim sdr As OleDbDataReader = cmd.ExecuteReader()
If sdr.Read = True Then
MsgBox("Login Successful")
Else
MsgBox("CHECK Username/Password")
End If
con.Close()
Catch ex As Exception
MsgBox("ERROR!")
End Try
End Sub
End Class
Reply
Answers (
0
)
convert vb6 code to vb.net
Drag-and-Drop in VB?