Delete whole table with SQL and ADO

K

Ken

I access a table in Access 2007 from ArcGIS using ADO and SQL. I would
like to add some code in my form in GIS that reconciles the backup database
from my laptop.
Can anyone give me an Idea of the SQL to "Drop" the existing backup table
then Make a new backup with the existing, renaming (to include the date).
any help is greatly appreciated.
 
K

Ken

I read about the "Drop" table, but Its how to incorporate it with ADO. All
I've ever done is ...rst.open "select...." Then manipulate the data. Since
I'm not dealing with a record set I'm not sure how to introduce the Drop
table command.
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Something like this:

Dim cnx As New ADODB.Connection

With cnx
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open "Data Source=" & CurrentDb.Name
End With

' Substitute your table name for "table_name."
cnx.Execute "DROP table_name"

cnx.Close

HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSjhBGIechKqOuFEgEQLnSwCg/kUSm0OeGn3Qlam3gDwfpr6z/M4AoPyy
FGpwsYkBzwM1vxCIPK08Fg50
=ZjjH
-----END PGP SIGNATURE-----
 

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