If Text1.Text = "" Then MsgBox "Please select a langguage first.", vbExclamation, "Code Library version 1.1": Text1.SetFocus: Exit Sub
On Error GoTo Err:
With rs_folder
'Check if there is no record
If .RecordCount < 1 Then MsgBox "No folder to delete.", vbExclamation, "Code Library version 1.1": Exit Sub
'Confirm deletion of record
Dim ans As Integer
ans = MsgBox("Are you sure you want to delete the selected folder?" & vbCrLf & vbCrLf & "WARNING:Deleting folder will delete also all files related on it.", vbCritical + vbYesNo, "Confirm Record Delete")
Me.MousePointer = vbHourglass
If ans = vbYes Then
'Delete the record
cn.Execute "Delete * From tblListFolders Where FolderName ='" & TreeView1.SelectedItem & "' and Langguage ='" & Text1.Text & "'"
.Requery
reload_folder
MsgBox "Folder has been successfully deleted.", vbInformation, "Confirm"
End If
ans = 0
Me.MousePointer = vbDefault
End With
Exit Sub
Err:
Call prompt_err(Err)
Resume Next
End Sub
Private Sub Command3_Click()
If Text1.Text = "" Then MsgBox "Please select a langguage first.", vbExclamation, "Code Library version 1.1": Text1.SetFocus: Exit Sub
If rs_folder.RecordCount < 1 Then MsgBox "No folder to edit.", vbExclamation, "Code Library version 1.1": Exit Sub
Dim strFolder As String
Dim oldFolder As String
oldFolder = TreeView1.SelectedItem
strFolder = InputBox("Enter the new name of '" & oldFolder & "' folder:", "Edit Existing Forder")
If strFolder = "" Then Exit Sub
Call remove_some_txt(strFolder)
If LCase$(oldFolder) <> LCase$(strFolder) Then
If if_folder_exist("tblListFolders", "Where FolderName ='" & strFolder & "' and Langguage ='" & Text1.Text & "'", cn) = True Then Exit Sub
Else
MsgBox "No changes made.", vbInformation, "Code Library version 1.1"
Exit Sub
End If
Dim rs_ed_folder As New ADODB.Recordset
Call set_rec_getData(rs_ed_folder, cn, "Select * From tblListFolders Where FolderName ='" & oldFolder & "' and Langguage ='" & Text1.Text & "'")
With rs_ed_folder
If .RecordCount < 1 Then MsgBox "There is a changes in record since it was last modified.", vbExclamation, "Code Library version 1.1": Exit Sub
.Fields(1) = strFolder
.Update
End With
MsgBox "Changes in folder has been successfully saved.", vbInformation, "Code Library version 1.1"
FRM_UPDATE_REC.seconds = 3
FRM_UPDATE_REC.Show vbModal
rs_folder.Requery
reload_folder
strFolder = ""
strFolder = ""
End Sub
Private Sub Command4_Click()
If ListView1.ListItems.Count < 1 Then Exit Sub
If ListView1.SelectedItem = "" Then Exit Sub
On Error GoTo Err:
With rs_files
'Check if there is no record
If .RecordCount < 1 Then MsgBox "No file to delete.", vbExclamation, "Code Library version 1.1": Exit Sub
'Confirm deletion of record
Dim ans As Integer
ans = MsgBox("Are you sure you want to delete the selected file?", vbCritical + vbYesNo, "Confirm Record Delete")
Me.MousePointer = vbHourglass
If ans = vbYes Then
'Delete the record
cn.Execute "Delete * From tblFiles Where FolderNo =" & table_id("tblListFolders", "Where FolderName ='" & TreeView1.SelectedItem & "' and Langguage ='" & Text1.Text & "'", cn) & " and Title ='" & ListView1.SelectedItem & "'"
.Requery
reload_files
MsgBox "File has been successfully deleted.", vbInformation, "Confirm"