Hash sign in table name problems

Posted on 2001-07-11
Last Modified: 2012-08-14
I have an Access Database whith a table name that contains a hash sign [BASIC#1]

My SQL statements work well when executed in MS-Query, but when I put the database onto the webserver, I get errors because of the hash sign.  I assume that the hash sign has some special meaning in ODBC or an other layer.
SQL = "SELECT * FROM [BASIC#1] WHERE ([BASIC#1].[ID]=" & request.form("ID") & ")"

Is there a way of avoiding this problem - apart from renaming the table?
Question by:VB-tinkerer

Expert Comment

ID: 6275655

Try this:

SQL = "SELECT * FROM BASIC#1 WHERE (ID=" & request.form("ID") & ")"

And if canot work, tell me what error you got!

Wee Siong

LVL 20

Accepted Solution

Silvers5 earned 150 total points
ID: 6275743
fast comment..\


SQL = "SELECT * FROM [BASIC##1] WHERE [ID]=" & request.form("ID")

also try to response.write the SQL statement before the execution to see what's in it.. maybe the form field is empty..

LVL 49

Expert Comment

ID: 8451599
Upon review of the comments here, I am recommending this disposition:

        points to Silvers5

Please post a comment if you disagree.

DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 8492588
per recommendation.

Community Support Moderator @Experts Exchange

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now