

Public Class ClassIndexFunctions
    Public Shared Function FileExistsinDropTable(Filename As String)
        Dim check As String
        Try
            If Filename.Contains("'") Then
                Filename = Filename.Replace("'", "''")
            End If
            check = "SELECT COUNT(*) FROM TBGI_FILES_USER WHERE UPPER(FILENAME2WORK) = UPPER('" & Filename & "') AND WORKED = 0"
            Dim result = ClassDatabase.Execute_Scalar(check, MyConnectionString, True)
            Return result
        Catch ex As Exception
            MsgBox("Error in FileExistsinDropTable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & check, MsgBoxStyle.Critical)
            Return Nothing
        End Try

    End Function
End Class
