David McAfee
dmcafee at pacbell.net
Wed Dec 7 18:22:21 CST 2005
Does anyone see what I am missing? I am trying to update some rows in a temporary Access database by changing any pipes ( | ) to apostrophes ( ' ). It runs through the code just fine. It's like the dataset is writing the updates back to the table. Dim strTemp As String Dim row As DataRow Dim ds As DataSet Dim da As OleDbDataAdapter Dim conn As OleDbConnection Dim mystr As String Dim Connstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MOMS_UPDATE\MOMS_UPDATE.MDB;Persist Security Info=False" Dim mySQL = "SELECT ItemNo, Desc1 FROM Itemmast WHERE Desc1 Like " & Chr(34) & "%|%" & Chr(34) & ";" Try conn = New OleDbConnection(Connstr) da = New OleDbDataAdapter(mySQL, conn) ds = New DataSet da.Fill(ds) For Each row In ds.Tables(0).Rows strTemp = "" strTemp = replacePipes(row.Item("Desc1")) row.BeginEdit() 'row("Desc1") = replacePipes(row("Desc1")) row.Item("Desc1") = strTemp 'row.EndEdit() row.AcceptChanges() Next 'ds.AcceptChanges() da.Update(ds.Tables(0)) MessageBox.Show("dONE") Catch ex As Exception MessageBox.Show("Error " & Err.Number & " : " & ex.Message.ToString()) End Try