How to use ADO for editing with if

W

Wahab

Hi
I wnat to convert my DAO recordset to ADO but I m not getting how I will
manage this with ADO now I m using DAO recordset which is as follows:

Set rst = db.OpenRecordset("SELECT * from tEmployeeData WHERE CardNO=" &
CardNo & "")
If rst.RecordCount = 1 Then
rst.Edit
Else
rst.AddNew
rst!CardNo = CardNo
rst!EmpName= EmpName
In short if record is present it will appear for editing else i will add new
record.
please let me know.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top