How to update the record with sql update
rs("Yazaradi") = txtYa.Text
rs("Kitapadi") = txtEa.Text
rs("Yayinevi") = txtYe.Text
rs("ISBN") = txtIsbn.Text
rs.Update
As I use this code to update, it updates the record but leaves the old record behind. Actually it doesn't work properly.
Ok, I would like to know how to use the sql update in the code above to update the record properly. Could somebody give an example?
Thank you
Re: How to update the record with sql update
Are your controls binded to a data control? You may need to refresh the data control after your update to reflect the changes or try...
VB Code:
rs("Yazaradi") = txtYa.Text
rs("Kitapadi") = txtEa.Text
rs("Yayinevi") = txtYe.Text
rs("ISBN") = txtIsbn.Text
rs.Update
[B]rs.Requery[/B]
Re: How to update the record with sql update
That's not really a SQL update. That would be something like:
strSQL = "UPDATE tblBook SET Yazaradi = '" & txtYa & "', Kitapadi = '" & txtEa & "', 'etc
then execute the SQL.