当前位置: 代码迷 >> ASP.NET >> C# 连接Access 的奇怪有关问题?()
  详细解决方案

C# 连接Access 的奇怪有关问题?()

热度:2477   发布时间:2013-02-26 00:00:00.0
C# 连接Access 的奇怪问题?(请指教)
我用C#连接Access一直出错:
代码:   String   connectionString   =   @ "Provider=Microsoft.Jet.OLEDB.4.0;Data   Source=E:\DB\User.mdb ";
OleDbConnection   connection   =   new   OleDbConnection();
OleDbCommand   command   =   new   OleDbCommand();
connection.ConnectionString   =   connectionString;
command.Connection   =   connection;
connection.Open();
command.CommandText   =   "delete   *   from   User   where   id=1 ";
command.ExecuteNonQuery();
connection.Close();

数据库权限没问题。

错误是:执行SQL语句出错!System.Data.OleDb.OleDbException:   FROM   子句语法错误。


请指教!!!!!!!!!!

------解决方案--------------------------------------------------------
user 是关键字。改为:

delete * from [User] where id=1
  相关解决方案