cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Steve\Documents\Visual Studio 2010\Projects\Church Of Glory\Church Of Glory\Registry.accdb"
cmd.CommandText = "update Registry set relaship = '" + ComboBox3.Text + "',fathnam = '" + fathnam.Text + "',dob = '" & DateTimePicker1.Value & "',age = '" + age.Text + "',addr = '" + addr.Text + "',area = '" + areas.Text + "',city = '" + city.Text + "',zipc = '" + pinc.Text + "',conta = '" + cnct.Text + "',email = '" + email.Text + "',occup = '" + occu.Text + "',bap_stat = '" + bap_stat + "',bap_dat = '" & DateTimePicker2.Value & "',mar_stat = '" + mar_stat + "',mar_dat = '" & DateTimePicker3.Value & "',gen = 'Male' where fnam = '" + ComboBox2.Text + "' and lnam = '" + ComboBox1.Text + "'"
cmd.Connection = cn
cn.Open()
cmd.ExecuteNonQuery()
MsgBox("Update Successful")
cn.Close()
This code runs perfectly in my system.. but it says
oledb exception was unhandled "data type mismatch"
when i copied the code and executed it in my brother's computer.. i carefully changed the data source path... i'm just a beginner.. all the field type is text except for the dates.. i ve one more field which is an autonumber and i don want that in my update query.. so i left it..