Shouldn't the ExecuteNonQuery be TRUE if it finds a record and FALSE is not?
I get FALSE all the time and I seeded the database with the email address.
I just want to check if record exist before moving on.
If this doesn't work I guess I could load a datatable and check to see if
rows 0.
Dim cnString As OleDbConnection
cnString = New OleDbConnection ("Provider=Micr oSoft.Jet.OLEDB .4.0; Data
source = " & Server.MapPath( "Someplace.mdb" ))
Dim CheckCus As New OleDbCommand("S ELECT * from Cus where EMailAddress =" &
QM & Trim(txtEMail.T ext) & QM, cnString)
CheckCus.Connec tion.Open()
If CheckCus.Execut eNonQuery() Then
txtFirstName.Te xt = "Yes"
Else
txtFirstName.Te xt = "No " & Now
End If
CheckCus.Connec tion.Close()
Thanks
Tony
Comment