问题描述
public void Update()
{
OleDbConnection conn = new OleDbConnection(Provider = Microsoft.Jet.OLEDB.4.0; Data Source = D:\\\ \\ employees.mdb);
conn.Open();
OleDbCommand cmd = new OleDbCommand(UPDATE [employee] SET([Name],[Jobtitle], [公司])值('+姓名+','+作业标题+,+公司+'),其中[EmpID] ='+ EmpID +',conn);
cmd.ExecuteNonQuery();
conn.Close();
}
public void Update()
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\Employees.mdb");
conn.Open();
OleDbCommand cmd = new OleDbCommand("UPDATE [employee] SET ([Name],[Jobtitle],[Company])Values ('" + Name + "','" + Jobtitle + "','" + Company + "') where [EmpID] = '" + EmpID + "'", conn);
cmd.ExecuteNonQuery();
conn.Close();
}
推荐答案
这篇关于我在更新语句中有语法错误。 (Ms Access),我需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!