问题描述
我需要将VB.NET应用程序中的表单数据插入到Microsoft Access数据库中.
I need to insert form data from my VB.NET application to a Microsoft Access database.
使用以下语法时出现错误"Syntax error in INSERT INTO statement"
:
I am getting the error "Syntax error in INSERT INTO statement"
when using the following syntax:
INSERT INTO bs1 (teacher, subject, date, period)
VALUES ('test', 'test', 'test', 'test')
我承认我已经习惯了MySQL类型的语法,在此问题上的任何帮助将不胜感激,谢谢.
I'll admit I'm used to the MySQL type syntax, any help on this matter would be greatly appreciated, thanks.
推荐答案
我相信date
是保留字.您需要将保留的字段名称封装在方括号中:
I believe date
is a reserved word. You need to encapsulate the reserved field names in square brackets:
INSERT INTO bs1 (teacher, subject, [date], period) VALUES ('test', 'test', 'test', 'test')
请参阅以下文章,以获取Access 2002及更高版本中保留字的完整列表: http://support.microsoft.com/kb/286335
See the following article for a complete list of reserved words in Access 2002 and greater:http://support.microsoft.com/kb/286335
〜md5sum〜
这篇关于MS Access INSERT INTO语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!