Thanks for sharing your solution. I solved the same problem in my application
some time ago by changing the table name, but reading your solution will help
me in the future.
regards
Andries
________________________________
Slide scanning / dia's scannen
vanaf / from
E0,08c
www.scancare.nl
________________________________
________________________________
From: c80840 <[email protected]>
To: [email protected]
Sent: Tue, March 2, 2010 1:47:03 AM
Subject: [delphi-en] Re: MS ACCESS/ADO/RENAME
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 delphi...@yahoogrou ps.com, "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!!!!!
>
[Non-text portions of this message have been removed]