⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 data_grid.form.frm

📁 Attendance Report System of student in Visual Basic and Oracle AS Backend
💻 FRM
字号:
VERSION 5.00
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form data_grid_from 
   BackColor       =   &H00E4F9FA&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Attendance View"
   ClientHeight    =   10995
   ClientLeft      =   45
   ClientTop       =   390
   ClientWidth     =   15000
   FillStyle       =   0  'Solid
   ForeColor       =   &H00E4F9FA&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   10995
   ScaleWidth      =   15000
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Command1 
      Caption         =   "Exit"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   15.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   12960
      TabIndex        =   9
      ToolTipText     =   "Close"
      Top             =   6720
      Width           =   1215
   End
   Begin MSFlexGridLib.MSFlexGrid A_MFG 
      Height          =   5175
      Left            =   3120
      TabIndex        =   8
      Top             =   5400
      Width           =   9255
      _ExtentX        =   16325
      _ExtentY        =   9128
      _Version        =   393216
      Rows            =   1
      Cols            =   6
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Palatino Linotype"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.TextBox txt_roll 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   450
      Left            =   6240
      MaxLength       =   4
      TabIndex        =   7
      ToolTipText     =   "Enter Roll No Here"
      Top             =   2040
      Width           =   1575
   End
   Begin VB.CommandButton Cmd_view 
      Caption         =   "View"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   6720
      TabIndex        =   5
      ToolTipText     =   "Shows Attandance View"
      Top             =   4560
      Width           =   1815
   End
   Begin VB.CommandButton cmd_date 
      Caption         =   "Date"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   15.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   8880
      TabIndex        =   4
      ToolTipText     =   "Click To Select Date"
      Top             =   2040
      Width           =   1215
   End
   Begin MSACAL.Calendar datecal 
      Height          =   2895
      Left            =   10560
      TabIndex        =   3
      ToolTipText     =   "Click To Select Date"
      Top             =   1920
      Width           =   4335
      _Version        =   524288
      _ExtentX        =   7646
      _ExtentY        =   5106
      _StockProps     =   1
      BackColor       =   15856113
      Year            =   2006
      Month           =   10
      Day             =   4
      DayLength       =   1
      MonthLength     =   0
      DayFontColor    =   64
      FirstDay        =   1
      GridCellEffect  =   1
      GridFontColor   =   0
      GridLinesColor  =   -2147483632
      ShowDateSelectors=   -1  'True
      ShowDays        =   -1  'True
      ShowHorizontalGrid=   -1  'True
      ShowTitle       =   -1  'True
      ShowVerticalGrid=   -1  'True
      TitleFontColor  =   192
      ValueIsNull     =   0   'False
      BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.ComboBox sub_cmb 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   450
      ItemData        =   "data_grid.form.frx":0000
      Left            =   6240
      List            =   "data_grid.form.frx":0002
      Style           =   2  'Dropdown List
      TabIndex        =   1
      ToolTipText     =   "Click To Select Subject"
      Top             =   2880
      Width           =   1695
   End
   Begin VB.ComboBox CMB_TPO 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   450
      Left            =   8040
      Style           =   2  'Dropdown List
      TabIndex        =   0
      ToolTipText     =   "Click To Select"
      Top             =   2880
      Width           =   855
   End
   Begin VB.Label Label7 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Attendance View Form"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   36
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   1335
      Left            =   3000
      TabIndex        =   10
      Top             =   240
      Width           =   9615
   End
   Begin VB.Label Label1 
      BackColor       =   &H00E4F9FA&
      Caption         =   "Enter Roll No: "
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3120
      TabIndex        =   6
      Top             =   2040
      Width           =   2535
   End
   Begin VB.Label Label5 
      BackColor       =   &H00E4F9FA&
      Caption         =   "Select Subject:"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3120
      TabIndex        =   2
      Top             =   2880
      Width           =   2775
   End
End
Attribute VB_Name = "data_grid_from"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As New ADODB.Recordset
Dim db As New ADODB.Connection
Dim attentryfalg As Boolean
Dim yrstr, SDATE As String
Dim i, j, k, rollno, recordcount, dd, mm, yy, fe, se, te, be, yr As Integer


Private Sub cmb_div_Click()
Set rs = Nothing
rs.Open "SELECT * FROM ARS_SUBASSIGN ", db, adOpenKeyset, adLockPessimistic
i = 0
sub_cmb.Clear
While Not rs.EOF
If (rs.Fields(3) = 124 And cmb_year.Text = rs.Fields(1) And cmb_div.Text = rs.Fields(2)) Then
sub_cmb.AddItem rs.Fields(4), i
i = i + 1
End If
rs.MoveNext
Wend

End Sub

Private Sub CMB_YEAR_Click()
Set rs = Nothing
rs.Open "SELECT * FROM ARS_SUBASSIGN ", db, adOpenKeyset, adLockPessimistic
i = 0
cmb_div.Clear
While Not rs.EOF
If (rs.Fields(3) = 124 And cmb_year.Text = rs.Fields(1)) Then
cmb_div.AddItem rs.Fields(2), i
i = i + 1
End If
rs.MoveNext
Wend
End Sub

Private Sub cmd_date_Click()
datecal.Visible = True
End Sub

Private Sub Cmd_view_Click()
If (txt_roll.Text = "" Or sub_cmb.Text = "" Or CMB_TPO.Text = "" Or dd = 0 Or mm = 0 Or yy = 0) Then
MsgBox "Select All Field", vbInformation, "Message"
Else

A_MFG.TextMatrix(0, 0) = "ROLL NO"
A_MFG.TextMatrix(0, 1) = "DATE"
A_MFG.TextMatrix(0, 2) = "SUBJECT"
A_MFG.TextMatrix(0, 3) = "TYPE"
A_MFG.TextMatrix(0, 4) = "BATCH"
A_MFG.TextMatrix(0, 5) = "P/A"

Set rs = Nothing
rs.Open "SELECT  *  FROM ARS_ATTENTRY  ", db, adOpenKeyset, adLockPessimistic

i = 1
j = 0
While Not rs.EOF

If (rs.Fields(8) = CInt(txt_roll.Text) And rs.Fields(4) = sub_cmb.Text And rs.Fields(0) = CDate(SDATE) And rs.Fields(6) = CMB_TPO.Text) Then
With A_MFG
            .Rows = .Rows + 1
            .TextMatrix(i, j) = rs.Fields(8)
            .TextMatrix(i, j + 1) = rs.Fields(0)
            .TextMatrix(i, j + 2) = rs.Fields(4)
            .TextMatrix(i, j + 3) = rs.Fields(6)
            If rs.Fields(5) = Null Then
            .TextMatrix(i, j + 4) = ""
            End If
            If (rs.Fields(7) = 1) Then
            .TextMatrix(i, j + 5) = "P"
            Else
            .TextMatrix(i, j + 5) = "A"
            End If
             
            i = i + 1
               j = 0
                          
End With
End If
rs.MoveNext
Wend
End If
End Sub

Private Sub Command1_Click()
ARS_MDI.Enabled = True
Unload Me
End Sub

Private Sub datecal_Click()
dd = datecal.Day
mm = datecal.Month
yy = datecal.year
SDATE = Str(mm) + " / " + Str(dd) + " / " + Str(yy)
End Sub

Private Sub Form_Load()
datecal.Visible = False

db.Open "Provider=OraOLEDB.Oracle.1;Password=TIGER;Persist Security Info=True;User ID=SCOTT"

 Set rs = Nothing
 

End Sub

Private Sub sub_cmb_Click()
Set rs = Nothing
rs.Open "SELECT * FROM ARS_SUBASSIGN ", db, adOpenKeyset, adLockPessimistic
i = 0
CMB_TPO.Clear
While Not rs.EOF
If (yrstr = rs.Fields(1) And sub_cmb.Text = rs.Fields(4)) Then
If (rs.Fields(5) = 1) Then
CMB_TPO.AddItem "TH", i
i = i + 1
End If

If (rs.Fields(6) = 1) Then
CMB_TPO.AddItem "PR", i
i = i + 1
End If

If (rs.Fields(7) = 1) Then
CMB_TPO.AddItem "OR", i
i = i + 1
End If
End If
rs.MoveNext
Wend
End Sub

Private Sub txt_roll_KeyPress(KeyAscii As Integer)
If (KeyAscii <> 8) Then
If Not (KeyAscii >= 48 And KeyAscii <= 57) Then
KeyAscii = 0
MsgBox "Only Numeric Data!", vbOKOnly, "Error Message"
End If
End If
sub_cmb.Clear
End Sub

Private Sub txt_roll_LostFocus()
yr = Mid(txt_roll.Text, 1, 1)
If (yr = 1) Then yrstr = "FE"
If (yr = 2) Then yrstr = "SE"
If (yr = 3) Then yrstr = "TE"
If (yr = 4) Then yrstr = "BE"


Set rs = Nothing
rs.Open "SELECT * FROM ARS_SUBASSIGN", db, adOpenKeyset, adLockPessimistic
i = 0
sub_cmb.Clear
While Not rs.EOF
If (rs.Fields(1) = yrstr) Then
sub_cmb.AddItem rs.Fields(4), i
i = i + 1
End If
rs.MoveNext
Wend

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -