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

VB图书管理系统毕业论文 第16页

更新时间:2009-8-15:  来源:毕业论文
VB图书管理系统毕业论文 第16页
Private Sub Command1_Click()
Dim rs_reader As New ADODB.Recordset
Dim sql As String
findform = True
sql = "select * from 借阅信息 where 读者姓名='" & Combo2.Text & "'"
rs_reader.CursorLocation = adUseClient
rs_reader.Open sql, conn, adOpenKeyset, adLockPessimistic
Set DataGrid1.DataSource = rs_reader
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
End Sub
Private Sub Command2_Click()
Dim rs_book As New ADODB.Recordset
Dim sql As String
findform = False
sql = "select * from 借阅信息 where 书籍编号='" & Combo3.Text & "'"
rs_book.CursorLocation = adUseClient
rs_book.Open sql, conn, adOpenKeyset, adLockPessimistic
Set DataGrid1.DataSource = rs_book
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
End Sub
Private Sub Command3_Click()
Dim book_num As String
Dim reader_num As String
Dim answer As String
Dim rs_back As New ADODB.Recordset
Dim sql As String
On Error GoTo delerror
book_num = DataGrid1.Columns(3).CellValue(DataGrid1.Bookmark)
reader_num = DataGrid1.Columns(1).CellValue(DataGrid1.Bookmark)
answer = MsgBox("确定要还这本书吗?", vbYesNo, "")
If answer = vbYes Then
   sql = "select * from 借阅信息 where 书籍编号='" & book_num & "'"
   rs_back.CursorLocation = adUseClient
   rs_back.Open sql, conn, adOpenKeyset, adLockPessimistic
   rs_back.Delete
   rs_back.Update
   rs_back.Close
   sql = "select * from 书籍信息 where 书籍编号='" & book_num & "'"
   rs_back.CursorLocation = adUseClient
   rs_back.Open sql, conn, adOpenKeyset, adLockPessimistic
   rs_back.Fields(7) = "否"
   rs_back.Update
   rs_back.Close
   sql = "select * from 读者信息 where 读者编号='" & reader_num & "'"
   rs_back.CursorLocation = adUseClient
   rs_back.Open sql, conn, adOpenKeyset, adLockPessimistic
   rs_back.Fields(8) = rs_back.Fields(8) - 1
   rs_back.Update
   rs_back.Close
   If findform = True Then
      Command1_Click
   Else
      Command2_Click
   End If
   MsgBox "成功删除!", vbOKOnly + vbExclamation, ""
   DataGrid1.AllowDelete = False
Else
   Exit Sub
End If
delerror:
If Err.Number <> 0 Then
   MsgBox Err.Description
End If
rs_reader.Close
sql = "select * from 借阅信息"
rs_book.CursorLocation = adUseClient
rs_book.Open sql, conn, adOpenKeyset, adLockPessimistic
If Not rs_book.EOF Then
   Do While Not rs_book.EOF
      Combo3.AddItem rs_book.Fields(3)
      Combo4.AddItem rs_book.Fields(4)
      rs_book.MoveNext
   Loop
End If
rs_book.Close
End Sub

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

VB图书管理系统毕业论文 第16页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

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