毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

Visual Basic6.0+SQL Server2000图片管理系统 第6页

更新时间:2008-8-9:  来源:毕业论文

Visual Basic6.0+SQL Server2000图片管理系统 第6页
图书借出代码如下:
Private Sub Command1_Click()
  If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text9.Text = "" Then
  MsgBox "
输入的借书信息不完全!", , "提示信息"
  Else
    rs.Open "select  sum(
借书数量) from dzjstb where 读者编号
='" + Text1.Text + "'", cnn, adOpenKeyset, adLockOptimistic
    Adodc3.RecordSource = "select * from sz"
    Adodc3.Refresh
    If rs.Fields(0) + Val(Text9.Text) > Adodc3.Recordset.Fields(0) Then
       MsgBox "
您的借书量已满!!", vbOKOnly, "提示
"
       rs.Close
       Exit Sub
    Else
     Adodc2.RecordSource = "select * from books where
条码号
='" + Text3.Text + "'"
     Adodc2.Refresh
         If Adodc2.Recordset.RecordCount > 0 Then
             cnn.Execute ("insert into dzjstb values('" & Text1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "'," & Text5.Text & ",'" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text10 & "','" & DTPicker1 & "','" & DTPicker2 & "','
')")
             x = Val(Adodc2.Recordset.Fields("
复本数
")) - Val(Text9.Text)
             y = Val(Adodc2.Recordset.Fields("
借书数量
")) + Val(Text9.Text)
             hs1 = "update books set
复本数='" & x & "',借书数量='" & y & "'where 条码号
='" & Text3.Text & "'"
            cnn.Execute (hs1)
          Else
          End If
    End If
       MsgBox "
借出完毕!", vbOKOnly, "提示
"
    Set rs = Nothing
  End If
End Sub
5.3.3
读者还书管理

窗体界面设计如下:

图书归还代码如下:
Private Sub Command1_Click()
    Dim hs, js, i As String
    Dim hs1, sz1 As String
    Dim x, y, z As Integer
    If Text1.Text = "" Or Text2.Text = "" Then
     MsgBox "
请输入读者编号和条码号", , "提示信息"
     Text2.SetFocus
    Else
    i = MsgBox("
确认归还该图书吗!", vbYesNo + vbOKOnly, "提示
")
    If i = vbYes Then
        Set rs = cnn.Execute("insert into hsstb values('" & Text1 & "','" & Text2 & "','" & Text3 & "'," & Text5.Text & ",'" & Text6 & "','" & Text7 & "','" & Text8 & "','" & DTPicker1 & "','" & DTPicker2 & "','" & Text9 & "','" & DTPicker3 & "','" & Text10 & "')")
        Adodc1.Refresh
        Adodc3.RecordSource = "select * from books where
条码号
='" & Text1.Text & "'"
        Adodc3.Refresh
        If Adodc3.Recordset.RecordCount > 0 Then
          Adodc2.RecordSource = "select * from dzjstb where
条码号='" & Text1.Text & "' and 读者编号
='" + Text2.Text + "'"
          Adodc2.Refresh
           If Adodc2.Recordset.RecordCount > 0 Then
            x = Val(Adodc3.Recordset.Fields("
复本数")) + Val(Adodc2.Recordset.Fields("借书数量
"))
            y = Val(Adodc3.Recordset.Fields("
借书数量")) - Val(Adodc2.Recordset.Fields("借书数量
"))
            hs1 = "update books set
复本数='" & x & "',借书数量='" & y & "'where 条码号
='" & Text1.Text & "'"
            cnn.Execute (hs1)
            Else
            End If
        End If
        js = "update dzjstb set
='',借书数量='0' where 条码号
='" & Text1.Text & "'"
        cnn.Execute (js)
        Adodc2.Refresh
        MsgBox "
还书成功!", vbOKOnly, "提示
"
    Else
        On Error Resume Next
        rs.CancelUpdate
    End If
    End If
End Sub

上一页  [1] [2] [3] [4] [5] [6] [7] [8] 下一页

Visual Basic6.0+SQL Server2000图片管理系统 第6页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。