update problem

Joined
Nov 7, 2008
Messages
20
Programming Experience
Beginner
Dim cmd As OleDbCommand
Dim str As String
conn.Open()
str = "Update table1 set emp_name='" & TextBox2.Text & "', city='" & TextBox3.Text & "', " _
& "attendance='" & TextBox4.Text & "' salary='" & TextBox5.Text & "'"
cmd = New OleDbCommand(str, conn)
cmd.ExecuteNonQuery()

conn.Close()


===============================================

I have tried to update the entry but it is not working..........


CAn any one help me ......how to update data of ms access database ?
 
I threw a couple of textboxes on a form and checked out what was actually in str

Update table1 set emp_name='2', city='3', attendance='4' salary='5'

Looks like you're missing a comma. Using a parameterized query would have made this much easier to spot.
 
Back
Top