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
- Payroll System (179)
- A Simple Add, Edit, Delete, and Search using VB and MSAccess (162)
- Hotel Reservation System (VB.NET) (129)
- Students Information System (121)
- Library Management Software (118)
- How to Add/Update/Delete Record using MS Access Database (115)
- Free Hotel Management System Manual (104)
- Hotel Reservation System (101)
- Library System Source Code (94)
- how to unload form and load a new form (92)
- 1 of 204
- ››
Random Post
- Multi-column combobox in datagrid (28,703)
- extracting string (1,295)
- HTML, CSS, PHP & JavaScript Code Beautifier (1,500)
- Johnfamouz HTML Template 1 (2,003)
- Keylogger in c# (parallel implementation) (4,045)
- TO ALL Programmers (2,331)
- Connect an OLEDB with MS Access 2007 Files (1,986)
- Simple 3D ^__^ (1,740)
- New way to impress/propose your girl/boy friends (1,686)
- LINQ(Language Integrated Query) (2,772)
- 1 of 133
- ››
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.