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

VB文档管理系统设计及源代码 第15页
  i = i + 1
    End If
    adoPrimaryRS.MoveNext
  Loop While Not adoPrimaryRS.EOF
  End Sub
Private Sub Command5_Click()
Delete = MsgBox("确实要删除该节点吗", vbOKCancel, "删除节点")
If Delete = vbOK Then
adoPrimaryRS.Delete
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
  Command1.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = True
Command5.Enabled = False
End If
End Sub
Private Sub Form_Load()
Left = (Screen.Width - Width) \ 2
Top = (Screen.Height - Height) \ 2
 Set mynod = TreeView1.Nodes.Add(, , "sort", "案卷名称及卷号" & "(" & "00" & ")")
 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
  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)
Text4.Text = Left$(Right$(Node.Text, 3), 2)
If Text4.Text <> "00" Then
  Set adoPrimaryRS = New Recordset
  adoPrimaryRS.Open "select 卷号,卷名,备注,创卷人员,创卷日期 from sort where 卷号 like '%" & Text4.Text & "%'", db, adOpenStatic, adLockOptimistic
 Text1.Text = adoPrimaryRS.Fields("卷号")
 Text2.Text = adoPrimaryRS.Fields("卷名")
 Text3.Text = adoPrimaryRS.Fields("备注")
Else
 Text1.Text = "00"
 Text2.Text = ""
 Text3.Text = ""
 End If
 End Sub
档案柜窗体源代码:
Dim WithEvents adoPrimaryRS As Recordset
Private Sub Combo1_Click()
Text3.Text = ""

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

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