HOWTO: Use ADO To Query An Access Table With A Space In ItsID: Q189683
|
ADO allows you to query a table based solely on its name. If just a table name is specified, ADO prepends select * from and executes that query. If the table you want to query is an Access table with a space in its name, you need to place square brackets around the table's name.
If you want to query the Order Details table in the Access Northwind (NWind.MDB) database that ships with many products using ADO, you need to use code like the following:
rsOrderDetails.Open "[Order Details]", cnNWind, adOpenStatic, _
adLockReadOnly, adCmdTable
You can also use the back quote if you need to use the table name with
spaces. For example:
select * from `Order Details`.
NOTE: You can only use the back quote in Access.
http://support.microsoft.com/support/default.asp
Additional query words: kbADO150 kbADO200 kbVBp500 kbVBp600 kbMDAC200
Keywords : kbADO150 kbADO200 kbVBp500 kbVBp600 kbMDAC200
Version : WINDOWS:1.5,2.0,5.0,6.0
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: May 26, 1999