Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 运行时错误3134无法识别问题_Sql_Vba_Ms Access 2007 - Fatal编程技术网

Sql 运行时错误3134无法识别问题

Sql 运行时错误3134无法识别问题,sql,vba,ms-access-2007,Sql,Vba,Ms Access 2007,基于onclick事件,我在以下代码上得到一个运行时错误3134 strEnt = "INSERT INTO EntList (EntityID, BusinessUnit, EntityName, Position, Location, Client, Dept, DistKey, Salary, Currency, SQ&A, BillRate, Util%, MeritDate, MeritRate) " & _ "VALUES ('" &

基于onclick事件,我在以下代码上得到一个运行时错误3134

   strEnt = "INSERT INTO EntList (EntityID, BusinessUnit, EntityName, Position, Location, Client, Dept, DistKey, Salary, Currency, SQ&A, BillRate, Util%, MeritDate, MeritRate) " & _
         "VALUES ('" & Me.EntityID & "', '" & Me.BusinessUnit & "', '" & Me.EntityName & "', '" & Me.Position & "', '" & Me.Location & "', '" & Me.Client & "', '" & Me.Dept & "', '" & Me.DistKey & "', '" & Me.Salary & "', '" & Me.Currency & "', '" & Me.SG_A & "', '" & Me.BillRate & "', '" & Me.Util_ & "', '" & Me.MeritDate & "', '" & Me.Merit_ & "');"
Debug.Print strEnt
CurrentDb.Execute strEnt
debug.print命令将以下代码输出到即时窗口

    INSERT INTO EntList (EntityID, BusinessUnit, EntityName, Position, Location, Client, Dept, DistKey, Salary, Currency, SQ&A, BillRate, Util%, MeritDate, MeritRate) VALUES ('Test10', 'CSS Overhead', 'Walter Tester', 'AutoentryTest', '01002 TELETECH SERVICE CORPORATION', '0001 US LABOR ARB CLIENT', '001 CORPORATE/COMPANY ALLOCATIONS', 'DAE', '250000', 'USD', '0', '300', '1', '', '');

就我所知,一切看起来都应该正常工作,有人能帮我看看我缺少了什么吗?

您试图执行的Access SQL:

INSERT INTO EntList (EntityID, BusinessUnit, EntityName, Position, 
                     Location, Client, Dept, DistKey, Salary, Currency, 
                     SQ&A, BillRate, Util%, MeritDate, MeritRate) 
            VALUES ('Test10', 'CSS Overhead', 'Walter Tester', 'AutoentryTest', 
                    '01002 TELETECH SERVICE CORPORATION', '0001 US LABOR ARB CLIENT', 
                    '001 CORPORATE/COMPANY ALLOCATIONS', 'DAE', '250000', 'USD', '0', 
                    '300', '1', '', '');
包含一些无效的列名引用
SQ&A
绝对不是有效的引用,而且
Util%
Currency
也可能无效。前两个无效,因为它们包含的字符对于无引号的名称引用无效。而
Currency
可能是无效的,因为它可能是一个保留字(我不确定这一个)

解决这个问题的方法是用括号(
[…]
)引用它们:


Currency
Position
都是。谢谢,我完全忘了。我将立即检查并重新运行,并对结果进行评论。就是这样。我也有一些错误,我也错误地命名了一些列。谢谢你在这件事上的帮助。这当然允许我看到下一个错误,即运行时错误440,但我将开始一个新的问题。
INSERT INTO EntList (EntityID, BusinessUnit, EntityName, Position, 
                     Location, Client, Dept, DistKey, Salary, [Currency], 
                     [SQ&A], BillRate, [Util%], MeritDate, MeritRate) 
            VALUES ('Test10', 'CSS Overhead', 'Walter Tester', 'AutoentryTest', 
                    '01002 TELETECH SERVICE CORPORATION', '0001 US LABOR ARB CLIENT', 
                    '001 CORPORATE/COMPANY ALLOCATIONS', 'DAE', '250000', 'USD', '0', 
                    '300', '1', '', '');