SQL+VB图书管理系统(数据库+源代码+论文) 第7页
.ColSel = .Cols - 1
End If
End With
End Sub
Public Sub MoveNext(ctr As Control)
With ctr
If .Row < .Rows - 1 Then
.Row = .Row + 1
.Col = 0
.RowSel = .Row
.ColSel = .Cols - 1
End If
End With
End Sub
Public Sub MoveLast(ctr As Control)
With ctr
.Row = .Rows - 1
.Col = 0
.RowSel = .Row
.ColSel = .Cols - 1
End With
End Sub
Public Sub Main()
strcnn = "provider=sqloledb.1;integrated security=sspi;database=tushu"
frm_login.Show
End Sub
3.4.2 图书征订设置界面代码设计
Private Sub Form_Load()
Dim sql As String
sql = "select * from 图书征订"
ShowData sql, Me.MSFlexGrid1
Me.MSFlexGrid1.ColAlignment(0) = flexAlignCenterCenter
Me.MSFlexGrid1.ColWidth(1) = 1000
Me.MSFlexGrid1.ColWidth(2) = 1500
Me.MSFlexGrid1.ColWidth(3) = 1500
Me.MSFlexGrid1.ColWidth(10) = 2500
Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Dim sql As String, rtn As Long
Select Case Button.Index
Case 1
Frm_zdxz.Caption = "图书征订添加"
Frm_zdxz.Show 1
Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
Case 2
With Frm_zdxz
.Caption = "图书征订修改"
.Txt_zdbh.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 0)
.Txt_tsid.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 1)
.Txt_dgname.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 2)
.Txt_lxfs.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 3)
.Txt_dgsl.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 4)
.Txt_dgdj.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 5)
.Dtpk_dgrq.Value = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 6)
.Cmb_sfys.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 7)
.Dtpk_ysrq.Value = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 8)
.Cmb_czy.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 9)
.Txt_bz.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 10)
.Show 1
End With
Case 3
If MsgBox("确定要删除吗?", vbYesNo + vbQuestion, "提示") = vbYes Then
sql = "delete from 图书征订 where 征订编号='" _
+ Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 0) + "'"
rtn = Update(sql)
If rtn = 0 Then
sql = "select * from 图书征订"
ShowData sql, Me.MSFlexGrid1
MsgBox "删除成功!", vbOKOnly + vbInformation, "提示"
Me.StatusBar1.Panels(1).Text = "总共有" & Me.MSFlexGrid1.Rows - 1 & "条记录"
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>