mysql - I want to display an error if the employee had an account already -


here code:

 rs.open("select * tbl_emp_security emp_id='" & empid_account.text & "'", con)         if empid_account.text = lvempaccount.items(rs(0).value)             msgbox("this employee have existing account")         else             user_account.text = "emp" & lname_account.text             passrandom()     end if 

is if employee try add account , if had already... messagebox appear if none. proceeds next line..

empid_accout.text textbox comparing first item on table.

lvempaccount.tems(rs(0),value) item on 1st column employee id on table

i rewrite code follows

hope helps

dim outds new dataset outds = ("select * tbl_emp_security emp_id='" & empid_account.text & "'", con)  if outds isnot nothing andalso outds.table.rows.count > 0              msgbox("this employee have existing account")         else             user_account.text = "emp" & lname_account.text             passrandom()     end if 

if select query returns dataset , means has value used way..!


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -