不灭剑体吧 关注:2,882贴子:31,878

回复:估计没有人

只看楼主收藏回复

244-245
Private Sub Command1_Click()
Dim rstReader As New ADODB.Record
Dim sql As String, msg As String
If Option1.Value = True Then
sql = "逾期罚款<>0 and 状态 = '已还'"
Else
sql = " DateDiff('d', 还书日期,Date())>0 and 状态 = '未还'"
End If
If userpow = "guest" Then
sql = sql + "and 读者编号 = '" & userID & "'"
Else
If combo2.ListIndex = 0 Then
sql = sql
ElseIf Option2.Value = True Then
sql = sql + "and 读者姓名='" & combo2.Text & "' and DateDiff('d',还书日期,date())>0 and 状态='未还'"
sql = sql
ElseIf Option2.Value = True Then
sql = sql + "and 读者姓名='" & combo2.Text & "' and DateDiff('d',还书日期,date())>0 and 状态='未还'"
sql = sql
ElseIf Option2.Value = True Then
sql = sql + "and 读者姓名='" & combo2.Text & "' and DateDiff('d',还书日期,date())>0 and 状态='未还'"
End If
sql = "select * from 借阅信息 where " + sql
Set rstReader = ExeRecordset(sql, msg)
Set DataGrid1.DataSource = rstReader
DataGrid1.AllowAddNew = False
DataGrid1.AllowDelete = False
DataGrid1.AllowUpdate = False
End Sub


17楼2014-12-14 20:26
回复
    245-246
    Private Sub Form_Load()
    Dim rstReader As New ADODB.Recordset
    Dim sql As String, msg As String
    If userpow = "guest" Then
    combo1.Enabled = False
    combo2.Enabled = False
    End If
    combo1.AddItem "全部"
    combo2.AddItem "全部"
    sql = "select * from 读者信息"
    Set rstReader = ExeRecordset(sql, msg)
    If Not rstReader.EOF Then
    Do While Not rstReader.EOF
    combo1.AddItem rstReader.Fields(1)
    combo2.AddItem rstReader.Fields(0)
    rstReader.MoveNext
    Loop
    End If
    rstReader.Close
    combo2.ListIndex = 0
    Option1.Value = True
    End Sub
    Private Sub Option1_Click()
    Set DataGrid1.DataSource = Nothing
    End Sub
    Private Sub Option2_Click()
    Set DataGrid1.DataSource = Nothing
    End Sub


    18楼2014-12-14 20:27
    回复
      2026-08-04 03:11:23
      广告
      不感兴趣
      开通SVIP免广告
      186
      Dim rstBookStyle As New ADODB.Recordset
      Dim sql As String
      Dim msg As String
      If Trim(txtLeibie) = "" Then
      MsgBox "请输入图书种类!", 0 + 48, "警告!"
      txtLeibie.SetFocus
      Exit Sub
      End If
      If Trim(txtBianhao.Text) = "" Then
      MsgBox "请输入图书类别编号!", 0 + 48, "警告!"
      txtBianhao.SetFocus
      Exit Sub
      End If
      sql = "select * from 图书类别 where 类别名称 = '" & txtLeibie.Text & "'"
      Set rstBookStyle = ExeRecordset(sql, msg)
      If rstBookStyle.EOF Then
      sql = "insert into 图书类别(类别名称,类别编号) values('" & txtLeibie.Text & "','" & txtBianhao.Text & "')"
      ExeNonQuery sql, msg
      MsgBox "添加图书类别成功!", 0 + 64, "消息!"
      rstBookStyle.Close
      txtLeibie.Text = ""
      txtBianhao.Text = ""
      Else
      MsgBox "添加图书类别重复!", 0 + 64, "消息!"
      txtLeibie.SetFocus
      txtLeibie.Text = ""
      rstBookStyle.Close


      19楼2014-12-14 20:28
      回复
        当你看完这句话时,你的生命就减少了3秒钟,多么痛的领悟!


        IP属地:湖南来自Android客户端20楼2014-12-16 09:07
        回复