Question : Access DB: "There is no field named" in the table

Hi X-perts,

I am getting a strange problem with Access DB - I cannot delete columns via VB.NET or even directly executing SQL query in Access:

1) When running it from VB.NET (Jet 4.0 OLEDB) I am getting an exception "There is no field named......" though the field is definitely in the table

2) When I execute this query directly in Access, it returns "Object Invalid or no longer set", if the table is not opened

here is the query:

ALTER TABLE [Trend] DROP COLUMN [AMEX Composite PR]

What is the problem here?

Thanks

Answer : Access DB: "There is no field named" in the table

Well the syntax is ALTER TABLE [Table Name] DROP COLUMN [Column Name]... and if that doesn't work for some reason...

a. First try repairing your DB and retry the syntax above.
b. Rename the column into a much simpler one word name and delete it using...
EXEC sp_rename 'TableName.ColumnName', 'NewName', 'COLUMN'
Random Solutions  
 
programming4us programming4us