Closed DJimmie closed 5 years ago
Placed a button on the TDC Testing tab for the user to click and remove voided test plans when ready.
Used the following code: `Sub remove_void_TP()
Dim conn As Object, rst As Object Dim strSQL As String
Set conn = CreateObject("ADODB.Connection") Set rst = CreateObject("ADODB.Recordset")
'On Error GoTo No_Server_Available
' OPEN CONNECTION conn.Open "DRIVER=SQLite3 ODBC Driver;Database=\camradfs01.ccc.coopcam.com\testlab_i\CTC Test Plan Operations\TSMS_database.db"
strSQL = "DELETE FROM tsd_table_1 WHERE Test_Phase='Void'" ' OPEN RECORDSET rst.Open strSQL, conn, 1, 1
' FREE RESOURCES Set rst = Nothing Set conn = Nothing
Exit Sub
No_Server_Available: MsgBox "The Server is currently unavailable or you do not have the SQLite ODBC driver. Try again later or verify you have the ODBC driver installed on your PC." 'Exit Sub Application.Visible = True 'ThisWorkbook.Close savechanges:=False
End Sub`
allow the user to delete all Voided TPs from the Database.