Updating datasource with dataset problem -Microsoft Access

已答复 Updating datasource with dataset problem -Microsoft Access

  • 2012년 5월 1일 화요일 오전 4:52
     
      코드 있음

    Hi I'm attempting to update details to an external Microsoft access file, database connection to the file is ok.

    I'm getting the following syntax error on line "Dadapt.Update(Dset, "CustomerBook")" :

    OleDBException was unhandled

    Syntax error in UPDATE statement.

     Private Sub btnUpdate_Click(sender As System.Object, e As System.EventArgs) Handles btnUpdate.Click
            Dim CommandBuild As New OleDb.OleDbCommandBuilder(Dadapt)
            Dset.Tables("CustomerBook").Rows(count).Item(1) = txtbxName.Text
            Dset.Tables("CustomerBook").Rows(count).Item(2) = txtSurname.Text
            Dset.Tables("CustomerBook").Rows(count).Item(3) = txtbxaddress.Text
            Dset.Tables("CustomerBook").Rows(count).Item(4) = txtbxPost.Text
       -->  Dadapt.Update(Dset, "CustomerBook") 
            MsgBox("Details updated")
        End Sub

    This error only occurs when the dataset is changed before updating.

    any suggestions would be great!

    • 이동됨 Bob_BaoMVP 2012년 5월 3일 목요일 오전 4:25 (From:Visual Studio Tools for Office)
    •  

모든 응답