Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MS Access bugs me with SQL designer

0 views
Skip to first unread message

Tommy DN

unread,
Jun 7, 2005, 10:12:04 AM6/7/05
to
I want to write this SQL-query in MS Access:

INSERT INTO functie ( [afdeling - id], naam )
VALUES (1, 'test');

But when I save it and I execute it, it doesn't work because Access
delete the spaces in my field.

INSERT INTO functie ( [afdeling-id], naam )
VALUES (1, 'test');

But my field name is "afdeling - id". The SQL works fine in VB.Net, but
cannot be used as a query in the database itself. Is there a solution
without renaming the field? I tried everything.

Dirk Goldgar

unread,
Jun 7, 2005, 2:28:12 PM6/7/05
to
"Tommy DN" <tomm...@gmail.com> wrote in message
news:1118153524.7...@g44g2000cwa.googlegroups.com

You're right -- the query designer is stupid. I hadn't seen this
before, because I never embed improper characters in a field name, but
it seems whenever the query designer interprets the SQL string for
display or saves the design view, it removes the spaces surrounding the
"-". Interestingly, a field name that contains multiple consecutive
spaces doesn't get modified to be just one; it seems to be the "-"
character that confuses the designer.

One workaround is to create and save the query in SQL view. If you
never switch to design view, the SQL is not modified.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


0 new messages