向access添加数据时提示“insert into”用法错误
我是个新手,向access添加数据时提示“insertinto”用法错误,请求帮助!!OleDbConnectionconn=newOleDbConnection(@"P...
我是个新手,向access添加数据时提示“insert into”用法错误,请求帮助!!
OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\mydata.mdb");
OleDbCommand comm;
try
{
comm = new OleDbCommand();
comm.Connection = conn;
conn.Open();
comm.CommandText ="INSERT INTO User([UserNum],[Password],[Path]) VALUES ('"+txtUser.Text+"','"+txtPassword.Text+"','"+txtPath.Text+"')";
comm.ExecuteNonQuery();
}
finally
{
conn.Close();
} 展开
OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\mydata.mdb");
OleDbCommand comm;
try
{
comm = new OleDbCommand();
comm.Connection = conn;
conn.Open();
comm.CommandText ="INSERT INTO User([UserNum],[Password],[Path]) VALUES ('"+txtUser.Text+"','"+txtPassword.Text+"','"+txtPath.Text+"')";
comm.ExecuteNonQuery();
}
finally
{
conn.Close();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询