I have created an App with VB to create tables, enter info in the tables, and edit the tables. When a user created a table with a period in the name (3.4 Litre) and went to add parts to the table it threw a SQL error "invalid table name" (and listed the table name).
To add parts I first check with an SQL Statement to see if the part already exists since more than one person input data daily. I use the query "Select * from TableName where PartName = '" & txtPartName.text" If none exist I use the AddNew method in ADO to add the info. It will work with anything except a period in the table name. (at least everything I've tried)
This aroused my curiosity so I opened the SQL Query Analyzer and selected all of the table names from the SysObjects. I copied the table name and pasted it in the analyzer, added "select * from" in the front, and put the table name in brackets []. When I ran the query it worked. I also did the same with an InsertInto statement. It added the information into the field like it should.
NOW the kicker. I opened the table and tried to add information into it manually and it gave me the same error that my VB App did. "Invalid table name" (tablename)
What's the deal? Rob
Just my $.02.
To add parts I first check with an SQL Statement to see if the part already exists since more than one person input data daily. I use the query "Select * from TableName where PartName = '" & txtPartName.text" If none exist I use the AddNew method in ADO to add the info. It will work with anything except a period in the table name. (at least everything I've tried)
This aroused my curiosity so I opened the SQL Query Analyzer and selected all of the table names from the SysObjects. I copied the table name and pasted it in the analyzer, added "select * from" in the front, and put the table name in brackets []. When I ran the query it worked. I also did the same with an InsertInto statement. It added the information into the field like it should.
NOW the kicker. I opened the table and tried to add information into it manually and it gave me the same error that my VB App did. "Invalid table name" (tablename)
What's the deal? Rob
Just my $.02.