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

图书管理系统ER图-流程图-功能结构图-源代码 第17页

更新时间:2008-10-24:  来源:毕业论文

VB+Access图书管理系统

Private Sub Form_Unload(Cancel As Integer)

Set DataGrid1.DataSource = Nothing

rs_reader.Close

End Sub

11、文件名 frmfindreaderfrmfindreader.frm

功能说明:查询读者信息,可以选择性的输入读者姓名、读者编号、读者种类来查询读者的详细信息。

源代码:

Option Explicit

Private Sub Command1_Click()

Dim rs_findreader As New ADODB.Recordset

Dim sql As String

If Check1.Value = vbChecked Then

   sql = "读者编号='" & Trim(Text1.Text & " ") & "'"

End If

If Check2.Value = vbChecked Then

   If Trim(sql) = "" Then

      sql = "读者姓名='" & Trim(Text2.Text & " ") & "'"

   Else

      sql = sql & "and 读者姓名='" & Trim(Text2.Text & " ") & "'"

   End If

End If

If Check3.Value = vbChecked Then

   If Trim(sql) = "" Then

      sql = "读者类别='" & Trim(Combo1.Text & " ") & "'"

   Else

      sql = sql & "and  读者类别='" & Trim(Combo1.Text & " ") & "'"

   End If

End If

sql = "select * from 读者信息 where " & sql

rs_findreader.CursorLocation = adUseClient

rs_findreader.Open sql, conn, adOpenKeyset, adLockPessimistic

DataGrid1.AllowAddNew = False

DataGrid1.AllowDelete = False

DataGrid1.AllowUpdate = False

Set DataGrid1.DataSource = rs_findreader

End Sub

Private Sub Command2_Click()

Unload Me

End Sub

Private Sub Form_Load()

Dim rs_find As New ADODB.Recordset

Dim sql As String

sql = "select * from 读者类别"

rs_find.Open sql, conn, adOpenKeyset, adLockPessimistic

If Not rs_find.EOF Then

   Do While Not rs_find.EOF

      Combo1.AddItem rs_find.Fields(0)

      rs_find.MoveNext

   Loop

   Combo1.ListIndex = 0

End If

rs_find.Close

End Sub

12、文件名 frmfindborrowinfofrmfindborrowinfo.frm

功能说明:查询借书信息,可以查询到已借出的书、未借出的图书。

源代码:

Option Explicit

Private Sub Command1_Click()

Dim sql As String

Dim rs_find As New ADODB.Recordset

If Option1.Value = True Then

   sql = "select * from 书籍信息 where 是否被借出=''"

End If

If Option2.Value = True Then

   sql = "select * from 书籍信息 where 是否被借出=''"

End If

If Option3.Value = True Then

   sql = "select * from 借阅信息 where 读者姓名='" & Text1.Text & "'"

End If

   rs_find.CursorLocation = adUseClient

   rs_find.Open sql, conn, adOpenKeyset, adLockPessimistic

   DataGrid1.AllowAddNew = False

   DataGrid1.AllowDelete = False

   DataGrid1.AllowUpdate = False

   Set DataGrid1.DataSource = rs_find

End Sub

13、文件名  frmbackbookinfofrmbackbookinfo.frm

功能说明:添加还书信息,可以通过读者编号、读者姓名、图书编号、图书名称等查询到已借出的书。

源代码:

Option Explicit

Dim findform As Boolean

Private Sub Combo1_Click()

Combo2.ListIndex = Combo1.ListIndex

End Sub

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

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

图书管理系统ER图-流程图-功能结构图-源代码 第17页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

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