Shoot to kill!

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

MKoslof
12-19-2003, 08:41 AM
Quick and dirty...you 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.Open
cn.Properties("Jet OLEDB:Max Buffer Size") = 256

cn.Execute sSQL
cn.Close


End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum