这个查询有什么问题吗?

INSERT INTO tblExcel (ename, position, phone, email) VALUES ('Burton, Andrew', 'Web Developer / Network Assistant', '876-9259', 'aburton@wccs.edu') 

我有一个访问表,有五个字段:id,ename,位置,电话和电子邮件…每个是50个字符的纯文本字段,保存位置是255和id这是一个自动增量字段。 我正在使用VB.NET从Excel表中读取数据,该数据被推送到用于填写该查询的简单类中。 我对另外两个表做了同样的事情,他们的数据是从DB2表和MySQL表中抽取的。 另外两个工作,但这个简单的INSERT循环保持失败,所以我不认为这是我的“InsertNoExe”函数处理所有的OleDb的东西。

那么,呃,这个查询,字段标题等等是不是伪造的? 如果有人想看,我可以发表其他一些代码。

编辑:修正。 我不确定广泛的图像是否被算作堆栈溢出错误,这就是我为什么离开它的原因。

编辑2:我很密集。 我使用try … catch来查看伪造查询,甚至不检查ex.messsage。 嘎。

 INSERT INTO tblExcel (ename, position, phone, email) VALUES ('Burton, Andrew', 'Web Developer / Network Assistant', '876-9259', 'aburton@wccs.edu') at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at EmployeeList.EmployeeDatabase.ExeNonQuery(String sql) in C:\andy\html\code\vb\EmployeeList\EmployeeDatabase.vb:line 263 Syntax error in INSERT INTO statement. 

编辑3:谢谢你,克里斯。

我相信“职位”是一个保留字。

尝试…

插入tblExcel(ename,[位置],电话,电子邮件)VALUES(…

保留字

“网站开发人员/networking助理”的间隔看起来有些不可思议,也许在那里有一个隐藏的字符(回车?)

我会试着把斜杠拿出来,看看插入是否有效,如果不尝试把所有的标点符号都拿出来。 然后将其添加回来,也许你将能够识别错误。