Shoot to kill!

12-19-2003, 08:42 AM
Ok guys. Access. Open form, delete table if exists. How?

12-19-2003, 09:41 AM
Quick and really don't have to open a form, or even physically open an Access Object, just connect to Access db via an ADO connection string and kill the table you want:

Public Sub deleteTable()

Dim cn As New ADODB.Connection
Dim sSQL As String

sSQL = "DROP TABLE thisTable;"
strFile = "C:\Test.mdb"
cn.ConnectionString = strFile
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Properties("Jet OLEDB:Max Buffer Size") = 256

cn.Execute sSQL

End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum