Drop Table Causing Syntax Error

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
 
B

Brendan Reynolds

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"
 
M

Mike Thomas

Brendan,

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

Mike Thomas
 
M

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top