Hey All:

I've figured out the solution, without renaming table.  When you assign the 
table name, add a "[" before and "]" after the table name, like this:

"[table-name-with-dashes]"

I connect to the access database, display the table names, allow the user to 
select it from a listbox, then in the code add the "[" and "]" when I assign 
the table name to ADO table object.

Thanks to anyone that might have been trying to help me.

--- In [email protected], "c80840" <c80...@...> wrote:
>
> I started a project that is using ADO objects to access MS Access databases.  
> I discovered that ADO doesn't like table names with "-" embedded within them. 
>  If I rename the table so the "-" will be "_" (underscore), then I can access 
> the table just fine.
> 
> Well, I've been looking for some time, and from everything I can find, the 
> "ALTER TABLE <WHATEVER#1> RENAME TO <WHATEVER#2>" can't be used with 
> ADO/ACCESS databases.  This is even on the MS website.
> 
> Can anyone tell me how to solve this?  I don't want to alter the table name 
> in Access, because my users **MAY** not have access to MS Office.  The design 
> on the project is to have the users work on a COPY of the Access DB, so 
> renaming the table should be OK.
> 
> Thanks all!!!!!
>


Reply via email to