我的SQL语句出了什么问题?

时间:2022-03-06 00:12:20
SELECT * FROM [makes$] WHERE "Corporate Name"='Champion Enterprises, Inc.'

I'm running this query on an XLS excel file using ADO in VBA. There are about 10-20 records containing this corporate name but it returns EOF.

我在VBA中使用ADO在XLS Excel文件上运行此查询。大约有10-20条记录包含此公司名称,但它返回EOF。

I'm fairly new to database but I'm certain everything is correct aside from my SQL statement.

我对数据库很新,但除了我的SQL语句之外,我确信一切都是正确的。

If I SELECT * FROM [makes$], it returns all the records successfully.

如果我SELECT * FROM [make $],它会成功返回所有记录。

3 个解决方案

#1


4  

SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.'

#2


2  

total guess here but its probably

总猜在这里,但可能

SELECT * FROM [makes$] WHERE [Corporate Name]="Champion Enterprises, Inc."

#3


1  

Use [] instead of "" for column names with spaces in them:

对于包含空格的列名,请使用[]而不是“”:

SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.'

#1


4  

SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.'

#2


2  

total guess here but its probably

总猜在这里,但可能

SELECT * FROM [makes$] WHERE [Corporate Name]="Champion Enterprises, Inc."

#3


1  

Use [] instead of "" for column names with spaces in them:

对于包含空格的列名,请使用[]而不是“”:

SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.'