Klasse mit Konstruktor und Destruktor erzeugen

Public Class DBAccess
    Implements IDisposable 'erweitert Disposable

    ' allg Variable
    Private DB_OleDBConnection As System.Data.OleDb.OleDbConnection

    ' Konstruktor
    Public Sub New()
        DB_OleDBConnection = New System.Data.OleDb.OleDbConnection
    End Sub

    ' Destruktor
    Public Sub Dispose() Implements IDisposable.Dispose
        DB_OleDBConnection.Dispose()
        DB_OleDBConnection = Nothing
    End Sub
    
    ...
End Class