how to check availability of a field value in ms access

ritesh21

Member
Joined
Jan 21, 2008
Messages
7
Programming Experience
Beginner
Hi,
I'm using a VB form to add a new record to ms access. I have to check whether the input in the text box is already found in the table, and am using a "Check Availability" button to to this.

Part of the code is as follows:
DBCon.Open()
strsql = "SELECT * FROM Admin Where AdminID= '" & txtID.Text & " ' "
cmd = New OleDbCommand(strsql, DBCon)

But i'm stuck on the part to acknowledge if this record exist.

Can anyone provide the sql sample code in vb.net to do this action?
Thx in advance...
 
Back
Top