[ACCEPTED]-Query a table that has spaces in its name-tablename
Accepted answer
Surround the spaced out item with square 2 brackets:
[Common station]
Then slap the guy who designed 1 the database.
SELECT * FROM [My Crazy Table With Spaces and Other Chars!]
Use brackets to "quote" table and field 1 names.
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
Late to the party I know, but have just 7 solved my own issue here... Playing in access 6 2007 using ODBC connection to an SQL Db.
Table 5 name is Employee_Appointment Extra Detail 4 Custom Syntax to select is as follows SQlRecordSet.Open 3 "Select * from [Employee].[Appointment Extra 2 Detail Custom]", Conn, adOpenStatic, adLockOptimistic
Hope 1 this saves someone else a few hours of playing!
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.