Im stuck with my update statement for a access2000 file.
I have a table called email with 2 fields. (name and email)
I can Add to it just fine, but I cant update.
This is what I have
in my access table I have
Name Email
perry perry@hotmail.com
peter peter@hotmail.com
value1 = "newname"
Dim mycn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:/donation.mdb")
Dim mycmd As OleDbCommand = New OleDbCommand
mycmd.Connection = mycn
mycmd.CommandText = "UPDATE email SET name=value1 WHERE name=perry AND email=perry@hotmail.com)"
mycn.Open()
mycmd.ExecuteNonQuery()
mycn.Close()
it will fail on mycmd.ExecuteNonQuery()
What am I doing wrong?
I have a table called email with 2 fields. (name and email)
I can Add to it just fine, but I cant update.
This is what I have
in my access table I have
Name Email
perry perry@hotmail.com
peter peter@hotmail.com
value1 = "newname"
Dim mycn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & "C:/donation.mdb")
Dim mycmd As OleDbCommand = New OleDbCommand
mycmd.Connection = mycn
mycmd.CommandText = "UPDATE email SET name=value1 WHERE name=perry AND email=perry@hotmail.com)"
mycn.Open()
mycmd.ExecuteNonQuery()
mycn.Close()
it will fail on mycmd.ExecuteNonQuery()
What am I doing wrong?