Results 1 to 6 of 6
  1. #1
    Join Date
    May 2003
    Posts
    144

    Unanswered: # Sign On Create Table

    Hi, I have created a table with the following

    Create Table #Test(A int)

    and cannot find the table on my table list. My guess is that maybe the # that makes the table a "Vitual" table? So I started searching for "Create table #" on google and dbforums and cannot find anything. Can someone tell me what's special about having a #prefix on a table and where can I find more information about it?

    Thanks

    SHK

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    #1 I created table from Database window with name #Test and. it is created without problem and I can see it perfectly.

    #2 tried creating another table with following command on debug console and it gave error in SQL statement:
    docmd.RunSQL "create table #test2(A Int)"

    #3 tried again with following command with brackets around names and it created without problem:
    docmd.RunSQL "create table [#test3] (A Int)"

    just want to add that you have to refresh your database window to see result after creating with docmd. and another note; it is a good practice not using such symbols and white spaces in table and field names.
    ghozy.

  3. #3
    Join Date
    May 2003
    Posts
    144
    I created the table by using

    docmd.runSQL "CREATE TABLE #Test(A Int)"

    and it worked. I was able to add record and retrieve from it. I refreshed the database and even went to the enterprise manager and still couldn't find the table.

    Thanks

    SHK

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    hmm. weird. which version of access you are using? and is it mdb or adp project?
    ghozy.

  5. #5
    Join Date
    May 2003
    Posts
    144
    Access 2000 and adp.

  6. #6
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    I think it must be something with MS SQL 2000. I tried that on my Access 2002 with a mdb file and it didn't work. maybe when you work with MS SQL, Access send such SQL commands as pass thru, and bypass JetDB syntax checking? and MS SQL allows you to use # sign in your table names maybe?

    well you see why it is a good practice to not use white spaces and symbols in your table and field names.

    you could try to ask this in MS SQL forum I guess.
    Last edited by ghozy; 10-13-04 at 14:07. Reason: typo
    ghozy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •