ActiveX

Листинг к статье
" DataRepeater – особенности создания приложений".

Проект BaseViewControl

Option Explicit

Public Property Get pFrom() As String

    pFrom = lblFrom.Caption

End Property

Public Property Let pFrom(ByVal vNewValue As String)

    lblFrom.Caption = vNewValue

End Property

Public Property Get pTo() As String

    pTo = lblTo.Caption

End Property

Public Property Let pTo(ByVal vNewValue As String)

    lblTo.Caption = vNewValue

End Property

Public Property Get pSubject() As String

    pSubject = lblSubject.Caption

End Property

Public Property Let pSubject(ByVal vNewValue As String)

    lblSubject.Caption = vNewValue

End Property

Public Property Get pTime() As Date

    pTime = lblTime.Caption

End Property

Public Property Let pTime(ByVal vNewValue As Date)

    lblTime.Caption = vNewValue

End Property

Public Property Get pMsg() As String

    pMsg = txtMsg.Text

End Property

Public Property Let pMsg(ByVal vNewValue As String)

    txtMsg.Text = vNewValue

End Property

Проект BasaView

Option Explicit

Dim strDataBase$

Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, _
 ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, _
  ByVal pRecordset As ADODB.Recordset)

With Adodc1

    .Caption = "Запись № " & CStr(.Recordset.AbsolutePosition) & _
        " из " & CStr(.Recordset.RecordCount)

End With

End Sub

Private Sub Form_Load()

strDataBase = "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & _
    App.Path & "\VbRU_5_00.mdb;"

With Adodc1

    .ConnectionString = strDataBase

    .RecordSource = _
    "Select * from MsgHeader, MsgBody WHERE MsgHeader.MSGID=MsgBody.MsgID"

End With

Set DataRepeater1.DataSource = Adodc1

End Sub

К статье

Hosted by uCoz