sh
DataGrid1.AllowAddNew = False
DataGrid1.AllowUpdate = False
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