rs.Update not working

Please help me to resolve the rs.Update issue. Nothing is happening in the database after rs.Update
Dim db As New MySQLCommunityServer
db.Host = “localhost”
db.Port = 3306
db.DatabaseName = “new”
db.UserName = “root”
db.Password = “admin”
If db.Connect Then
Dim d As New Date
Dim ps As PreparedSQLStatement=db.Prepare("SELECT * FROM repgen WHERE dates = ? ")
ps.BindType(0, MySQLPreparedStatement.MYSQL_TYPE_STRING)
Dim rs As RecordSet = ps.SQLSelect
If rs <> Nil Then
rs.Field(“ev1”).StringValue =“2”
If db.Error Then MsgBox(db.ErrorMessage)
End If
If db.Error Then MsgBox(db.ErrorMessage)
End If

this is my code . I’m getting the values in the MsgBox but its not getting updated in the database .

why not do it the “easy way”

UPDATE repgen SET ev1=“2” where dates =

I’d recommend Dave’s suggestion as well.

As for why your code isn’t working, for one thing, you are not checking for errors after the commit, you’re only checking after the connect, and if the RecordSet is nil.

In addition to checking for rs <> Nil (an error condition), also check for Not rs.EOF (no records returned).