Query a table that has spaces in its name

后端 未结 4 1983
醉酒成梦
醉酒成梦 2020-12-11 04:17

I have a situation, I have a Access table named Gas Flow Rates that I want to add records. When I try to run my insert query for a similar table Common Station<

相关标签:
4条回答
  • 2020-12-11 04:36

    SELECT * FROM [My Crazy Table With Spaces and Other Chars!]

    Use brackets to "quote" table and field names.

    0 讨论(0)
  • 2020-12-11 04:38

    Surround the spaced out item with square brackets:

    [Common station]
    

    Then slap the guy who designed the database.

    0 讨论(0)
  • 2020-12-11 04:38

    Late to the party I know, but have just solved my own issue here... Playing in access 2007 using ODBC connection to an SQL Db.

    Table name is Employee_Appointment Extra Detail Custom Syntax to select is as follows SQlRecordSet.Open "Select * from [Employee].[Appointment Extra Detail Custom]", Conn, adOpenStatic, adLockOptimistic

    Hope this saves someone else a few hours of playing!

    0 讨论(0)
  • 2020-12-11 04:47
      cmdnon.CommandText = "INSERT INTO '[Common station]' ( S1Flow, S2Flow, S3Flow, S4Flow) VALUES (9999,999, 999, 999)";
        //Once the above line works replace it with cmdnon.CommandText= "INSERT INTO Gas Flow Rates ( S1Flow, S2Flow, S3Flow, S4Flow) VALUES (9999,999, 999, 999)"
    
    0 讨论(0)
提交回复
热议问题