hello i have table table1 in ms access with two field username and password containing 3 record.pls help me to login from vb.net by searching username and password from table.
Loading
Share Your Source Code or Article
Do you have source code, articles, tutorials, web links, and books to share? You can write your own content here. You can even have your own blog.
Submit now...
Submit now...
Sponsor
Receive Free Updates
Today's popular content
- Hotel Reservation System (395)
- Payroll System (347)
- Free Hotel Management System Manual (321)
- Library Management Software (294)
- Sending SMS using AT Commands via GSM Modem/GSM Phone (receiving SMS-updated) (284)
- Point of Sale Software (283)
- Students Information System (281)
- Best thesis titles and systems for Information Technology student (251)
- Hotel Reservation System (VB.NET) (235)
- How to Add/Update/Delete Record using MS Access Database (211)
- 1 of 203
- ››
Random Post
- Exe file Encrypter Decrypter (1,578)
- SQL CREATE TABLE Statement (1,621)
- Discount Computation (2,311)
- ReportViewer: Passing Parameters to Sub Reports in RDLC (4,696)
- Student Book X Upgrade(Sql server 2008 R2) (1,690)
- Educational Computer Game Thesis (14,317)
- Sub Seven Trojan Horse (22,982)
- Microsoft Agent Control 2.0 (2,150)
- How to Add Yahoo Messenger Client and online Status to your website (6,303)
- Face Biometric Software (4,308)
- 1 of 132
- ››
Public sConn As OleDbConnection
Dim lDS As DataSet = New DataSet
Dim lDA As OleDbDataAdapter = New OleDbDataAdapter
Dim lDR As DataRow
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
sConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\db.mdb;Persist Security Info=False")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Login Button
sConn.Open()
lDA.SelectCommand = New OleDbCommand("SELECT * FROM table1 WHERE username='" & TextBox1.Text.ToString & "' and password='" & TextBox2.Text & "'", sConn)
lDS.Clear()
lDA.Fill(lDS)
If lDS.Tables(0).Rows.Count > 0 Then
' Put the codes for a VALID login
Else
' Codes for INVALID Login here!
End If
lDR = Nothing
lDS.Dispose()
lDA.Dispose()
sConn.Close()
End Sub
this was from a loginform template i have since 2003. Hope that helped.
Pages
Add new comment