Sub DELETE_SQL()
Dim oCon As ADODB.Connection
Dim oRS As ADODB.Recordset
Set oCon = New ADODB.Connection
oCon.ConnectionString = "Driver={SQL Native Client};Server=Server_Name;Database=DB_Name; Trusted_Connection=yes;"
oCon.Open
'Set oRS = New ADODB.Recordset
Set rs = oCon.Execute("DELETE FROM Table_Name_001")
Set rs = oCon.Execute("DELETE FROM Table_Name_002")
Set rs = oCon.Execute("DELETE FROM Table_Name_003")
Set rs = oCon.Execute("DELETE FROM Table_Name_004")
rs.Open
oCon.Close
MsgBox ("Successfully Data Deleted from the Database")
End Sub
No comments:
Post a Comment