Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

vb.net 2010 connent with access

5 views
Skip to first unread message

maskboyz

unread,
Dec 10, 2013, 4:19:25 AM12/10/13
to
Imports System.Data.OleDb
Public Class Form1
Dim con As New OleDbConnection

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.4.0;Data Source=C:\Users\Pinkmask-Boyz MK\Documents\LogIn.accdb"

End Sub
Public Function ask()

Dim dt As New DataTable
Dim ds As DataSet
help me with this code :(
// ds.Tables.Add(dt)
// con.Open()
// Dim da As New OleDbDataAdapter("SELECT * FROM User", con)
// da.Fill(dt)
For Each DataRow In dt.Rows
If txtusername.Text = DataRow.item(1) And txtpassword.Text = DataRow.item(2) Then
con.Close()
Return True
End If
Next
con.Close()
Return False

End Function



Private Sub btnlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlogin.Click
If ask() = True Then
MsgBox("loogin")
Else
MsgBox("wrong")
End If
End Sub
End Class

0 new messages