title: SQL Update not updating fields in Access Database
body: <p>I have been struggling with this problem for a couple days, and have not been able to find out what is wrong with the following code.  When I click a button to update, nothing gets updated. By the way, I am using an html table to display a customer's information, and then using those textboxes in the table to update the fields. But the SQL Update Statement just isn't working. Here is the code:</p>
  
  <pre><code>Protected Sub btnUpdate_Click(sender As Object, e As System.EventArgs) Handles btnUpdate.Click
  
      Dim myConnection As OleDbConnection 
  
      Dim myCommand As OleDbCommand  
  
      Dim ID As Integer 
  
      Dim mySQLString As String, strFirstName As String, strLastName As String, strPhone As String, strEmail, strComment As String, Employee As String, DateCalled, TimeCalled, DateEdited As datetime 
  
      myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\wfccdb\datagridview\app_data\t3corp.mdb;")  
  
      myConnection.Open()  
  
      ID = Request.QueryString.Item("r") 
  
      Employee = tbEMP.Text  
  
      strFirstName = tbFname.Text
  
      strLastName = tbLname.Text
  
      strPhone = tbPhone.Text 
  
      strEmail = tbEmail.Text 
  
      DateCalled = Convert.ToDateTime(tbDateCalled.Text)  
      TimeCalled = Convert.ToDateTime(tbTimeCalled.Text)  
      strComment = tbComment.Text  
      DateEdited = Now
  
      mySQLString = "UPDATE customers SET Employee='" + Employee + "', FirstName='" + strFirstName + "', LastName='" + strLastName + "', Phone='" + strPhone + "', Email='" + strEmail + "', DateCalled='" + DateCalled + "', " + _
      "TimeCalled='" + TimeCalled + "', Comment='" + strComment + "', DateEdited='" + DateEdited + "' WHERE ReferenceID=" &amp; Val(ID) &amp; "" 
  
      myCommand = New OleDbCommand  
  
      myCommand.Connection = myConnection
  
      myCommand.CommandText = mySQLString
  
      myCommand.ExecuteNonQuery()
      myConnection.Close()
  
  
  
      Response.Redirect("ViewEditRecords.aspx?r=" + Request.QueryString.Item("r"))
  
  
  End Sub 
  </code></pre>