Does anything look wrong with this statement? I can't find anything wrong with it...
UPDATE AccountInfo
SET First Name = 'Test', Last Name = 'Account', Street = 'Street', State = 'State', ZipCode = 55555
WHERE id = 1
I'm writing a VB program, and I'm implementing an edit feature. This is the problem code.
Public Function updateAccountInfo(ByVal cp As CPerson, ByVal fName As String, ByVal lName As String, ByVal address As String, ByVal state As String, ByVal zip As Integer) As Boolean
Dim sql, sql2 As String
sql = "UPDATE AccountInfo SET First Name = '" & fName & "', Last Name = '" & lName & "', Street = '" & address & _
"', State = '" & state & "', ZipCode = " & zip & " WHERE id = " & cp.returnIDOnlyNumber
sql2 = "UPDATE Accounts SET First Name = '" & fName & "', Last Name = '" & lName & "' WHERE id = " & cp.returnIDOnlyNumber
Return do_command(sql, sql2)
End Function
Private Function do_command(ByVal sql As String, ByVal sql2 As String) As Boolean
Dim command As OleDbCommand
Try
conn.Open()
command = New OleDbCommand(sql, conn)
command.ExecuteNonQuery()
conn.Close()
conn.Open()
command = New OleDbCommand(sql2, conn)
command.ExecuteNonQuery()
conn.Close()
Return True
Catch ex As Exception
Return False
End Try
End Function