VB文档管理系统设计及源代码 第18页

VB文档管理系统设计及源代码 第18页
End Sub
Private Sub Command9_Click()
adoPrimaryRS.Delete
End Sub
Private Sub DataGrid1_Click()
Text1.Text = adoPrimaryRS.Fields("卷号")
Text2.Text = adoPrimaryRS.Fields("卷名")
Text6.Text = adoPrimaryRS.Fields("组卷人")
Text3.Text = adoPrimaryRS.Fields("文件号")
Text5.Text = adoPrimaryRS.Fields("档案柜号")
Command4.Enabled = False
Command1.Enabled = True
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
End Sub
Private Sub Form_Load()
 Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2
 Dim db As Connection
 Set db = New Connection
  db.CursorLocation = adUseClient
  db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=dagl.mdb;"
  Set adoPrimaryRS = New Recordset
  adoPrimaryRS.Open "select 卷号,卷名,备注 from sort  ", db, adOpenStatic, adLockOptimistic
   adoPrimaryRS.MoveFirst
   Set mynod = TreeView1.Nodes.Add(, , "sort", "案卷名称及卷号" & "(" & "00" & ")")
  i = 0
  Do
   If Left(adoPrimaryRS.Fields("卷号"), 1) = 0 Then
    Set mynod = TreeView1.Nodes.Add("sort", tvwChild, "sort" & Str$(i), adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
    Loop While Not adoPrimaryRS.EOF
  adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 1 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(0), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
    Loop While Not adoPrimaryRS.EOF
adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 2 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(1), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
    Loop While Not adoPrimaryRS.EOF
  adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 3 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(2), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
  Loop While Not adoPrimaryRS.EOF
     adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 4 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(3), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
   Loop While Not adoPrimaryRS.EOF
    adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 5 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(4), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
   Loop While Not adoPrimaryRS.EOF
     adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 6 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(5), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
  Loop While Not adoPrimaryRS.EOF
     adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 7 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(6), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
    Loop While Not adoPrimaryRS.EOF
     adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 8 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(7), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
  Loop While Not adoPrimaryRS.EOF
    adoPrimaryRS.MoveFirst
  i = 0
  Do
  If Left(adoPrimaryRS.Fields("卷号"), 1) = 9 Then
    Set mynod = TreeView1.Nodes.Add("sort" & Str$(8), tvwChild, , adoPrimaryRS.Fields("卷名") & "(" & adoPrimaryRS.Fields("卷号") & ")")
    i = i + 1
    End If
    adoPrimaryRS.MoveNext
   Loop While Not adoPrimaryRS.EOF
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
 Dim db As Connection
  Set db = New Connection
  db.CursorLocation = adUseClient
  db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=dagl.mdb;"
  Set adoPrimaryRS = New Recordset
Text4.Text = Left$(Right$(Node.Text, 3), 2)
Text1.Text = Text4.Text
Text2.Text = Left$(Node.Text, Len(Node.Text) - 4)
If Text4.Text <> "00" Then
  Set adoPrimaryRS = New Recordset
  adoPrimaryRS.Open "select 卷号,卷名,文件号,文件名,作者,入库日期,内容摘要,档案柜号,入卷日期,组卷人,状态 from  file where 卷号 like '%" & Text4.Text & "%'", db, adOpenStatic, adLockOptimistic
Else
 Text1.Text = "00"
 Text2.Text = ""
  End If
Text6.Enabled = True
Text6.SetFocus
Command4.Enabled = True
Set DataGrid1.DataSource = adoPrimaryRS
End Sub
档案柜资料窗体的源代码:
Private Sub Command1_Click()
Form5.Text5.Text = DataGrid1.Text
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2
Dim db As Connection
  Set db = New Connection
  db.CursorLocation = adUseClient
  db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=dagl.mdb;"
  Set adoPrimaryRS = New Recordset
  adoPrimaryRS.Open "select  档案柜号,备注 from dag  ", db, adOpenStatic, adLockOptimistic
  Set DataGrid1.DataSource = adoPrimaryRS
End Sub
文件资料的窗体的源代码:
Private Sub Command1_Click()
Form5.Text3.Text = DataGrid1.Text
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2
Dim db As Connection
  Set db = New Connection
  db.CursorLocation = adUseClient
  db.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=dagl.mdb;"
  Set adoPrimaryRS = New Recordset
  adoPrimaryRS.Open "select  文件号,文件名,状态 from file where 状态='否' ", db, adOpenStatic, adLockOptimistic
  Set DataGrid1.DataSource = adoPrimaryRS
End Sub

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] 

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有