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.
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 just spent over an hour fixing some custom DateTime TextBox that only worked if the system clock was in a specific Dutch format (both CurrentCulture and CurrentUICulture had to match)
I'm sure it all works at the customer (for now), but as a developer I prefer having my OS in English because it's more Googleable.
And I REALLY don't know what to make of this
For n = 1To10
I wanted to apply the boy scout rule, but that's a full time job
There's new work (and a new customer) in it for me though.
Probably a new web or mobile application hosted in Azure
My bet is that the SMTP method runs asynchronously and they wanted to make sure it goes through before the code goes on.
Could be worse, I've inherited a code base that crashes when compiled in release build, works only in debug build. Thankfully, I am rid of it now.
"Application.DoEvents" ... i remember that one well; it was a mantra we used to sprinkle liberally on VB code (the dinosaur VB of the late neolithic, that is) when things got weird (and, they always got weird).
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
It could be worse in case of c++...
I faced the situation when inherited from a class which implement a method "Sleep".
For a lazy implementation while inheriting from that class I called Sleep in the assumption I'm calling the W32 Sleep. But instead of, it ended in something like this:
for (i = 0; i < 5; i++)
::Sleep(0.2 * cnMilliseconds);
I could kill that beast
It does not solve my Problem, but it answers my question
Some smtp systems don't like receiving too many send requests too close together, so you got to spread them out if say sending bulk individualized email.
(if you're relying on your ISP's mail handlers to send they purposely force inter-message delays to avoid spammers - often they'll let 5-10 go but then force you to wait before the next one will be allowed.)
I dealt with such myself for a client, needed to send monthly billing invoices (tens to few hundreds each day). Luckily in my case this ran overnight [batch job] so while I did have to incorporate a single (not loop of) 1/2 second sleep between messages. Actually I could reduce that down to 1/10th second, but being overnight why ride the edge? I didn't want to push it and get bitten by say network spikes etc - at 1/2 sec worst possible case would be couple of hours.
As to doing it in a loop (not defending it, just saying) - amateurish way to enable easier tuning i.e. "perhaps 9 loops of 450 will still be OK" ... big-wheel-small-wheel tuning. Something like the [old non digital] radios that have 2 tuning knobs: "tuning" & "fine tuning."
However, notice that the SMTP call is NOT in the loop
It's just a single email, unless it's called from within a loop (which happens at least once, but at least three times it's just a single email).
So... I guess it may be what you're saying, but handled very poorly?
I prefer the projects that have been going for a few years, and which has had multiple developers. You learn more from a brownfield than from a greenfield. Some applications contain more man-hours in knowledge than I can afford to spend.
So, you might not enjoy that particular work, but that's not a good generic reason for everyone to decline such an inheritance (which is what the title seemed to suggest to me).
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.