I need the syntax of queries in visual basic 6 to edit the database in ms access.please help me.The name of database is patient details and it has fields as name,id,height,weight,bmi,email,phone etc.
if the id is already matching i need to update the details and if its not matching i need to register it as a new user.
I need the syntax of the queries for doing this.

The sql statement will be something like -
patient details and it has fields as name,id,height,weight,bmi,email,phone etc.

Rs.Open "SELECT * FROM [patient details] WHERE id = " & "'" & txtId.Text & "'", cn, adopenstatic, adlockoptimistic

If Rs.BOF = True Or Rs.EOF = True Then

Rs.AddNew
Rs!name = txtName.Text
'and so on for all the other fields
Rs.Update

Else

Rs.name = txtName.Text
'and so on...
Rs.Update
End If