1

I'm having an issue connecting to a Access database table called tbl: Daily Sales because it has both spaces and a colon in the name.

Otherwise the connection to the same database works when I connect to a table with a name containing no spaces or special characters.

I am not allowed to change the table name.

How do I escape the table name?

Erik A
  • 31,639
  • 12
  • 42
  • 67
Melanie
  • 11
  • 1
  • 2

2 Answers2

1

you should be able to do something like this "[tbl: Daily Sales]"

CMS
  • 3,657
  • 1
  • 27
  • 46
1

Enclosing table names in brackets is good practice and is necessary when special characters(including spaces) are in the table name. Whatever is inside the brackets is the table name. Keep in mind, brackets are not limited to table names, but field names as well.

[tbl: Daily Sales].[fld: Amount]

For more info. Here: [] brackets in sql statements or here: What is the use of the square brackets [] in sql statements? or here: Meaning of square brackets [] in MS-SQL table designer?

Community
  • 1
  • 1
bp_
  • 402
  • 4
  • 14