how to drop and create a table using sql

G

Guest

I'm trying to drop and create a table in access 2003, but I keep getting a
syntax error. What is the correct sql code to use?

Thanks,
Akilah
 
B

Brendan Reynolds

The details, of course, depend on the specific fields, indexes, constraints
etc. you want to create, but here's a basic example ...

Public Sub TestDropCreate()

CurrentProject.Connection.Execute "DROP TABLE tblOne", , adCmdText
CurrentProject.Connection.Execute "CREATE TABLE tblOne (TestInt int)", ,
adCmdText

End Sub

Here's a link to the on-line help topic on the CREATE TABLE statement ...

http://office.microsoft.com/assistance/hfws.aspx?AssetID=HP010322201033
 

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