how to drop and create a table using sql

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top