Курсовая работа: Создание и обработка Баз данных средствами Visual Basic 60
Справка №3
Таблица PR и GL
Private Sub mnuSpravka3_Click()
Dim I As Integer, J as Integer
Dim Kz As Integer
Label5.Caption = "Справка №3(по таблицам GL и PR)"
Fls.Cols = 5: Fls.Rows = 1: Kz = 0
Fls.TextMatrix(0, 0) = Data1.Recordset.Fields(1).Name
Fls.TextMatrix(0, 1) = Data1.Recordset.Fields(2).Name
Fls.TextMatrix(0, 2) = Data1.Recordset.Fields(3).Name
Fls.TextMatrix(0, 3) = Data2.Recordset.Fields(1).Name
Fls.TextMatrix(0, 4) = Data2.Recordset.Fields(2).Name
Data1.Recordset.MoveFirst
For I = 1 To Data1.Recordset.RecordCount
Data2.Recordset.MoveFirst
For J = 1 To Data2.Recordset.RecordCount
If Data2.Recordset.Fields(0) = Data1.Recordset.Fields(0) Then
If Data1.Recordset.Fields(2).Value > 5000 And Data2.Recordset.Fields(1).Value > 20 And Data2.Recordset.Fields(2).Value > 20 Then
Fls.Rows = Fls.Rows + 1: Kz = Fls.Rows - 1
Fls.TextMatrix(Kz, 0) = Data1.Recordset.Fields(1).Value
Fls.TextMatrix(Kz, 1) = Data1.Recordset.Fields(2).Value
Fls.TextMatrix(Kz, 2) = Data1.Recordset.Fields(3).Value
Fls.TextMatrix(Kz, 3) = Data2.Recordset.Fields(1).Value
Fls.TextMatrix(Kz, 4) = Data2.Recordset.Fields(2).Value
End If
End If
Data2.Recordset.MoveNext