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

📄 a_stud.frm

📁 Attendance Report System of student in Visual Basic and Oracle AS Backend
💻 FRM
字号:
VERSION 5.00
Begin VB.Form A_STUD 
   BackColor       =   &H00C0C0FF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "STUDENT ATTENDACE REPORT"
   ClientHeight    =   2205
   ClientLeft      =   45
   ClientTop       =   390
   ClientWidth     =   6360
   FillColor       =   &H00C0C0FF&
   ForeColor       =   &H00C0E0FF&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2205
   ScaleWidth      =   6360
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton CMD_CANCEL 
      Caption         =   "CANCEL"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   3720
      TabIndex        =   3
      Top             =   1440
      Width           =   1455
   End
   Begin VB.CommandButton cmd_show 
      Caption         =   "SHOW"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1320
      TabIndex        =   2
      Top             =   1440
      Width           =   1455
   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          =   375
      Left            =   2640
      MaxLength       =   4
      TabIndex        =   0
      Top             =   480
      Width           =   2055
   End
   Begin VB.Label Label1 
      BackColor       =   &H00C0C0FF&
      Caption         =   "Enter Roll No:"
      BeginProperty Font 
         Name            =   "Palatino Linotype"
         Size            =   15.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   375
      Left            =   360
      TabIndex        =   1
      Top             =   480
      Width           =   2295
   End
End
Attribute VB_Name = "A_STUD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim rs As New ADODB.Recordset
Dim rollno, yr, i, j, k, l, m, n As Integer
Dim yrstr, subject(10), subjecttop(10) As String
Dim db As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim flag As Boolean
Dim addr, name1, subj(10), subtop(10) As String
Dim subl(10), subal(10), subp(10), subap(10) As Integer

Private Sub cmd_cancel_Click()
Set rs1 = Nothing
rs1.Open "select * from ars_report1", db, adOpenKeyset, adLockPessimistic
While Not rs1.EOF
rs1.Delete
rs1.Fields.Refresh
rs1.MoveNext
Wend
 
Set rs = Nothing
Set rs1 = Nothing
db.Close
ARS_MDI.Enabled = True
Unload Me
End Sub

Private Sub cmd_show_Click()
If (txt_roll.Text <> "") Then

    Set rs = Nothing
    rs.Open "SELECT * FROM ARS_attentry", db, adOpenKeyset, adLockPessimistic
    While Not rs.EOF
        k = 0
        While k <> j
        If (rs.Fields(8) = txt_roll.Text And rs.Fields(4) = subject(k)) Then
            If (rs.Fields(6) = "TH" Or rs.Fields(6) = "th") Then
                    subj(k) = rs.Fields(4)
                    subtop(k) = rs.Fields(6)
                    subl(k) = subl(k) + 1 'lecture
                        If (rs.Fields(7) = 1) Then subal(k) = subal(k) + 1
                           
            ElseIf (rs.Fields(6) = "PR" Or rs.Fields(6) = "pr") Then
                 subj(k) = rs.Fields(4)
                    subtop(k) = rs.Fields(6)
                subp(k) = subp(k) + 1 'practical
                
                If (rs.Fields(7) = 1) Then subap(k) = subap(k) + 1
                       
            End If
                       
                         
       End If
       k = k + 1
   Wend
   rs.MoveNext
   'rs1.MoveNext
           
Wend



k = 0
While subtop(k) <> ""

'MsgBox subtop(k) & subj(k)
k = k + 1
Wend
'k = k - 1 'NO OF RECORDS

rs1.Open "select * from ars_studentry", db, adOpenKeyset, adLockPessimistic
While Not rs1.EOF
    If (txt_roll.Text = rs1.Fields(0)) Then
        addr = rs1.Fields(5)
        name1 = rs1.Fields(1)
    End If
    rs1.MoveNext
Wend

Set rs1 = Nothing
rs1.Open "select * from ars_report1", db, adOpenKeyset, adLockPessimistic
  j = 0
 While j <> k
    rs1.AddNew
    rs1(0) = name1
    rs1(1) = txt_roll.Text
    rs1(2) = addr
    rs1(3) = subj(j)
    
        
  
    rs1(4) = subtop(j)
    If (subtop(j) = "th" Or subtop(j) = "TH") Then
        rs1(5) = subl(j)
        rs1(6) = subal(j)
        rs1(7) = CLng((subal(j) / subl(j)) * 100)
    
    Else
        rs1(5) = subp(j)
        rs1(6) = subap(j)
        rs1(7) = CLng((subap(j) / subp(j)) * 100)
    End If
    
        
j = j + 1

Wend

a_student.Show
  
Else
MsgBox "Please Enter The Roll No. Of Student!", vbInformation, "Message"
End If




End Sub

Private Sub Form_Load()

db.Open "Provider=OraOLEDB.Oracle.1;Password=TIGER;Persist Security Info=True;User ID=SCOTT"
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
End Sub

Private Sub txt_roll_LostFocus()
If txt_roll.Text <> "" Then
flag = False
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_attentry", db, adOpenKeyset, adLockPessimistic
i = 0
j = 0
While Not rs.EOF

If (rs.Fields(8) = txt_roll.Text) Then

      i = 0
     For i = 0 To j
        
        If (subject(i) = rs.Fields(4)) Then GoTo jmp
        
        Next i
       
      
               subject(j) = rs.Fields(4)
           
           If (rs.Fields(6) <> "") Then
            subjecttop(j) = rs.Fields(6)
           
          End If
           
           
            j = j + 1
      End If
 

jmp:
rs.MoveNext
Wend
End If

End Sub

⌨️ 快捷键说明

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