I am afraid the replace statement does not support MS access environment as stated by "Om Prakash Pant" and suggest the followings code - you may have to do bit of cleaning
try
{
OleDbConnection oConn = new OleDbConnection();
oConn.ConnectionString ="Provider =Microsoft.Jet.OLEDB.4.0; Data Source =C:\\TEST PROJECTS\\ACCESS 2003\\db1.mdb";
oConn.Open();
OleDbCommand oCmd = new OleDbCommand();
oCmd.Connection = oConn;
oCmd.CommandText = "Select grou from addcust where ID=1";
String strgrou = "";
using (var oReader = oCmd.ExecuteReader())
{
while (oReader.Read())
{
strgrou = oReader["grou"].ToString();
}
}
string str1="a";
string str2="b";
oCmd.Connection = oConn;
oCmd.CommandText = "update addcust set grou= '" + strgrou.Replace(str1, str2) + "' where id=1 ";
oCmd.ExecuteNonQuery();
MessageBox.Show("success");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}