help me update my database..
when i click edit it will add a new record..
i want to update a record..
to edit a new record it will be base on the cutsomer's nameu
Dim conn As ADODB.Connection
Dim RS As New ADODB.Recordset
Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=localhost;" _
& "DATABASE=database1;" _
& "UID=root;" _
& "PWD=;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
conn.CursorLocation = adUseClient
conn.Open
RS.Open "SELECT * from Phonebook", conn, adOpenStatic, adLockOptimistic
RS.Update
txtName.Text = RS!Customers_Name
RS!Address = txtAddress.Text
RS!Mobile = txtMobile.Text
RS!Telephone = txtTelephone.Text
RS.Update
MsgBox "Record has been Saved", vbInformation
RS.Close
conn.Close