The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
We are sorry but all our agents are busy at the moment. Your call is totally unimportant as far as we are concerned, but we could play you some really annoying music if you like. Why not send us a postcard with your favourite tunes?
Public Class Form3
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Database4.accdb")
Dim cmd As New OleDbCommand("select* from Table where [name]=@user and [address]=@pass", conn)
cmd.Parameters.Add("@user", OleDbType.VarChar).Value = TextBox1.Text
cmd.Parameters.Add("@pass", OleDbType.VarChar).Value = TextBox1.Text
Dim adapter1 As New OleDbDataAdapter(cmd)
Dim table As New DataTable
If table.Rows.Count <= 0 Then
MsgBox("Error username or password")
Wrong place to ask - it even says so at the top of the page in red letters!
Try here: Ask a Question[^] and please try to pay attention to where you are posting if you want people to help you for free rather than annoy them ...
And don't call your tables by SQL Reserved words: "Table" is either not the name of where you store that info, or you should change it. Not only is "Table" a reserved word, it tells nobody anythign about what kind of data it contains, and that's kinda important ...
Fix that, and your problem will go away.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
I'm currently doing a VB project
I don't have a lot of problems with VB, although I find C# a lot more elegant.
In theory VB and C# had pretty much the same capabilities and you could write clean code in both.
In practice, VB programmers are far more often a bunch of amateurish bunglers who couldn't write clean code if their life depended on it
That doesn't mean those people don't write C# code either!