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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -