How to write query with object names which has space and "/"?

  • Dear All,

    The front end is an MS Access 2003 ADP. The back end is an SQL

    Server 2005 database. I have a form that is based on a view. The view

    is based on a couple of tables. One of the table name is "Input/Output Log Details".

    So I put that name in query like "SELECT * FROM [Input/Output Log Details]"

    It can't be recognized in my project. How can I do?

    Anyone's help is welcomed and thanks.

    Best Regards ....

  • Do you have the rights necessary to access that table? Does the ADP file use the right connection string to have those rights? Is the table in the schema you are expecting? Can you include other tables from that database and schema in a view you are creating in Access?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Edit: original statement partially removed.

    However, if the view is defined at SQL Server side, it should work. At least the following code does:

    USE tempdb

    GO

    CREATE TABLE [a/totally silly / TABLE name] (sc INT)

    GO

    CREATE VIEW crap AS

    SELECT *

    FROM [a/totally silly / TABLE name]

    GO

    SELECT *

    FROM crap



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • yes. I have full right permission and connected to right connection.

    The case is, I created a view in SQL Server. View contains a couple of table and one of the table's name is "Input/Output Log Details". For Front end, I use Access 2003 and I put the View name in form's record source.

    The problem is that, access program can still recognize identity column when I use SQL 2000.

    But identity column is not recognized when I upgrade to SQL 2005.

    And I found the way to solve that identity column is recognized If I put SQL Query directly to my application form's record source instead of inserting view name to record source.

    So I wrote query as "Select [Input/Output Log Details].ColA, [Input/Output Log].ID FROM [Input/Output Log] INNER JOIN [Input/Output Log Details] ON [Input/Output Log Details].ID = [Input/Output Log].ID"

    and put it to record source. "[" is not recognized appear. Is there another way except of changing table names?

    Database is running in 9.0 compatibility mode.

    Thanks for your help sir.

    Best Regards,

    Ye` Yint

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply