VB+Access图书管理系统 第6页

VB+Access图书管理系统 第6页

Command2.Enabled = True

Command3.Enabled = True

Command4.Enabled = False

Command5.Enabled = False

End Sub

 

Private Sub Form_Load()

Command4.Enabled = False

DataGrid1.AllowAddNew = False

DataGrid1.AllowDelete = False

DataGrid1.AllowUpdate = False

If userpow = "guest" Then

Frame2.Enabled = False

End If

Exit Sub

loaderror:

MsgBox Err.Description

End Sub

 

Private Sub Form_Unload(Cancel As Integer)

Set DataGrid1.DataSource = Nothing

End Sub

 

窗体名:Form7

代码:

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

If Trim(sql) = "" Then

MsgBox "请选择查询方式!", vbOKOnly + vbExclamation

Exit Sub

End If

Adodc1.RecordSource = "select * from dzxx where " & sql

Adodc1.Refresh

DataGrid1.ReBind

DataGrid1.AllowAddNew = False

DataGrid1.AllowDelete = False

DataGrid1.AllowUpdate = False

 

End Sub

 

Private Sub Command2_Click()

Unload Me

End Sub

 

Private Sub Form_Load()

Dim i As Integer

Dim sql As String

Combo1.Clear

Adodc2.Recordset.MoveFirst

For i = 0 To Adodc2.Recordset.RecordCount - 1

Combo1.AddItem Adodc2.Recordset.Fields(0).Value

Adodc2.Recordset.MoveNext

Next

Combo1.ListIndex = 0

End Sub

 

窗体名:Form8

代码:

Private Sub Combo1_Change()

Combo2.ListIndex = Combo1.ListIndex

End Sub

 

Private Sub Combo2_Change()

Combo1.ListIndex = Combo2.ListIndex

End Sub

Option Explicit

Dim leibie As String

Dim qixian As Integer

Dim shumn As Integer

Dim maxnum As Integer

 

Private Sub Command1_Click()

Dim rs_borrowbook As New ADODB.Recordset

Dim sql As String

Adodc1.RecordSource = "select * from 读者信息 where 读者编号='" & Combo1.Text & ","

Adodc1.Refresh

leibie = Adodc1.Recordset.Fields(3)

shumu = Adodc1.Recordset.Fields(8)

Adodc1.RecordSource = "select * from 读者类别 where 种类名称='" & leibie & "'"

Adodc1.Refresh

qixian = Adodc1.Recordset.Fields(2)

maxnum = Adodc1.Recordset.Fields(1)

If shumu >= maxnum Then

MsgBox "该读者借书数额已满!", vbOKOnly + vbExclamation

Exit Sub

End Sub

 

Private Sub Command2_Click()

Unload Me

End Sub

 

Private Sub Form_Load()

Dim i As Integer

Adodc2.RecordSource = "select * from  书籍信息 where 书籍编号='" & book_num & "'"

Adodc2.Refresh

Label8.Caption = Adodc2.Recordset.Fields(0)

Label9.Caption = Adodc2.Recordset.Fields(1)

Label10.Caption = Adodc2.Recordset.Fields(2)

Label11.Caption = Adodc2.Recordset.Fields(3)

Label12.Caption = Adodc2.Recordset.Fields(4)

Label13.Caption = Adodc2.Recordset.Fields(5)

Label14.Caption = Adodc2.Recordset.Fields(6)

Combo1.Clear

Combo2.Clear

Adodc1.RecordSource = "select * from 读者信息"

Adodc1.Refresh

Adodc1.Recordset.MoveFirst

For i = 0 To Adodc1.Recordset.RecordCount - 1

Combo1.AddItem Adodc1.Recordset.Fields(1).Value

Combo2.AddItem Adodc1.Recordset.Fields(0).Value

Adodc1.Recordset.MoveNext

Next

Combo1.ListIndex = 0

Combo2.ListIndex = 0

End Sub

 

Private Sub Form_Unload(Cancel As Integer)

Unload Me

End Sub

 

窗体名:form9

代码:

Private Sub Command1_Click()

Dim sql As String

If Option1.Value = True Then

sql = "是否被借出=''"

End If

If Option2.Value = True Then

sql = "是否被借出=''"

End If

Adodc1.RecordSource = "select * from sjxx where " & sql

Adodc1.Refresh

DataGrid1.ReBind

DataGrid1.AllowAddNew = False

DataGrid1.AllowDelete = False

DataGrid1.AllowUpdate = False

End Sub

 

Private Sub Command2_Click()

Unload Me

End Sub

 

模块名:Module1

代码:

Option Explicit

Public conn As New ADODB.Connection

Public select_menu As String

Public userID As String

Public userpow As String

Public book_num As String

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

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