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

SQL+VB图书管理系统(数据库+源代码+论文) 第14页

更新时间:2009-6-3:  来源:毕业论文
SQL+VB图书管理系统(数据库+源代码+论文) 第14页
Case "图书ID"
      If Txt_cxnr.Text = "" Then
        MsgBox "请输入图书ID!", vbCritical + vbOKCancel, "提示"
        Txt_cxnr.SetFocus
        Exit Sub
       Else
        sql = "select * from 图书信息 where 图书ID like '%" + Trim(Txt_cxnr.Text) + "%'"
        Txt_cxnr.SetFocus
      End If
    Case "图书名称"
      If Txt_cxnr.Text = "" Then
        MsgBox "请输入图书名称!", vbCritical + vbOKCancel, "提示"
        Txt_cxnr.SetFocus
        Exit Sub
       Else
        sql = "select * from 图书信息 where 图书名称 like '%" + Trim(Txt_cxnr.Text) + "%'"
        Txt_cxnr.SetFocus
       End If
    Case "图书类型"
      If Txt_cxnr.Text = "" Then
        MsgBox "请单击按钮选择图书类型!", vbCritical + vbOKCancel, "提示"
        Txt_cxnr.SetFocus
        Exit Sub
       Else
       sql = "select * from 图书信息 where 图书类型='" + Trim(Txt_cxnr.Text) + "'"
       Txt_cxnr.SetFocus
      End If
    Case "所有图书信息"
       sql = "select * from 图书信息"
     
  End Select
  ShowData sql, Me.MSFlexGrid1
  Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
 
  If Frm_tscx.MSFlexGrid1.Rows <= 1 Then
   MsgBox "对不起!没有找到符合条件的记录!请重新输入查询内容!", vbOKCancel + vbInformation, "提示"
   Txt_cxnr.Text = ""
   Txt_cxnr.SetFocus
  Exit Sub
  End If
 
 
End Sub

Private Sub Form_Load()
Label2.Visible = False
  Txt_cxnr.Visible = False
  Command1.Visible = False
  Me.MSFlexGrid1.ColAlignment(0) = flexAlignCenterCenter
 Me.MSFlexGrid1.ColWidth(0) = 1800
 Me.MSFlexGrid1.ColWidth(1) = 1000
 'Me.MSFlexGrid1.ColWidth(2) = 4500
 
End Sub

 

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Index
  Case 3
  MoveFirst Me.MSFlexGrid1
   Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
 Case 4
  MovePre Me.MSFlexGrid1
   Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
 Case 5
  MoveNext Me.MSFlexGrid1
   Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
 Case 6
  MoveLast Me.MSFlexGrid1
   Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
 Case 8
  Frm_tscx.Refresh
 Case 9
  Unload Me
End Select
End Sub
3.4.5 用户登录界面代码设计
Private Sub cmb_qx_Click()
On Error GoTo lab
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sql As String
sql = "select * from 用户 where 用户权限='" + cmb_qx.Text + "'"
cnn.Open strcnn
rst.Open sql, cnn, 3, 1
cmb_yhm.Clear
Do While Not rst.EOF
cmb_yhm.AddItem rst!用户名
rst.MoveNext
Loop
rst.Close
cnn.Close
Exit Sub
lab:
MsgBox "请您先附加数据库!", vbExclamation, "提示"

End Sub
Private Sub Command1_Click()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sql As String

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

SQL+VB图书管理系统(数据库+源代码+论文) 第14页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

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