Loading

Add new comment

Anonymous
loginform

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.

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.