Листинг 2
Option Explicit
'-- Класс— дескрипто р таблицы базы данных
Private sTableName As String ' имя таблицы
Private oFields As Collection ' коллекция полей
Private sPrimaryKey As String ' первичный ключ
Private Sub Class_Initialize()
'-- Конструктор класса
sTableName = ""
Set oFields = Nothing
sPrimaryKey = "Primary_Key"
End Sub
Public Property Get Name() As String
Name = sTableName
End Property
Public Property Let Name(ByVal sNewValue As String)
sTableName = sNewValue
End Property
Public Property Get Fields() As Collection
Set Fields = oFields
End Property
Public Property Set Fields(ByVal oNewValue As Collection)
Set oFields = oNewValue
End Property
Public Property Get Key() As String
Key = sPrimaryKey
End Property
Public Property Let Key(ByVal sNewValue As String)
sPrimaryKey = sNewValue
End Property