Drop Table Causing Syntax Error

  • Thread starter Thread starter Mike Thomas
  • Start date Start date
M

Mike Thomas

I am thinking this must be a references problem.

When I try to use the "Drop Table" command as in:

Drop Table tt_temp

Access 2000/VBA generates a syntax error.

My references are:

Visual Basic for Applications
Msft Access 9.0 Object Library
Msft DAO 3.6 Object Library
Msft Excel 9.0 Object Library
Msft Calendar Control 9.0

Am I missing a reference?

Thanks
Mike Thomas
 
Where and how are you trying to use it? In a saved query, a SQL statement
executed from VBA code, something else?

You should be able to execute it from code using either
CurrentProject.Connection or CurrentDb ...

CurrentProject.Connection.Execute "DROP TABLE TestTable"
 
Brendan,

Thanks for your help. I was trying to run this from VB code. I'll give
your suggestion a try.

Mike Thomas
 
Brandan, your suggestion worked, and it answered another host of questions
I had had, but did not have a chance to investigate.

Mike Thomas
 
Back
Top