asp.net向ACCESS中插入记录
OleDbConnectionconn=newOleDbConnection();conn.ConnectionString="Provider=Microsoft.Je...
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("test.mdb");
conn.Open();
OleDbCommand comm = new OleDbCommand();
comm.Connection = conn;
comm.CommandText = "insert into test(no)values ('asfasdfsafas')";
comm.ExecuteNonQuery();
conn.Close();
打开页面时出现错误提示
INSERT INTO 语句的语法错误。
请问这是怎么回事,如何解决???
no字段为文本型,,,长度为20 展开
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("test.mdb");
conn.Open();
OleDbCommand comm = new OleDbCommand();
comm.Connection = conn;
comm.CommandText = "insert into test(no)values ('asfasdfsafas')";
comm.ExecuteNonQuery();
conn.Close();
打开页面时出现错误提示
INSERT INTO 语句的语法错误。
请问这是怎么回事,如何解决???
no字段为文本型,,,长度为20 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询