公交查询系统的设计与实现

乘客管理置

Private Sub ShowMSH()

Dim rs As New ADODB.Recordset rs.Open \乘客\

Set MSH.DataSource = rs

MSH.ColWidth(0) = 1100 MSH.ColWidth(1) = 0 MSH.ColWidth(2) = 2000

rs.Close

Set rs = Nothing End Sub

Private Sub Command1_Click(Index As Integer) Select Case Index Case 0 ADDYH Case 1 UPTYH Case 2 DELYH

Case 4 Unload Me End Select End Sub

Private Sub Form_Load() ShowMSH End Sub

Private Sub ADDYH() On Error GoTo ErrH

Dim rs As New ADODB.Recordset

rs.Open \乘客\

rs.AddNew

rs.Fields(0).Value = Trim(Text1(0)) rs.Fields(1).Value = Trim(Text1(1)) rs.Fields(2).Value = Trim(Combo1)

rs.Update rs.Close

Set rs = Nothing ShowMSH

MsgBox \添加成功!\ Exit Sub ErrH:

MsgBox Err.Description

End Sub

Private Sub UPTYH() On Error GoTo ErrH

Dim rs As New ADODB.Recordset

rs.Open \* from 乘客 where 姓名='\& Trim(MSH.TextMatrix(MSH.RowSel, 0)) & \ If rs.EOF = False Then

rs.Fields(1).Value = Trim(Text1(1)) rs.Fields(2).Value = Trim(Combo1) rs.Update rs.Close

Set rs = Nothing ShowMSH

Command1(1).Enabled = False Command1(2).Enabled = False MsgBox \修改成功!\ Else

rs.Update rs.Close

Set rs = Nothing End If Exit Sub

ErrH:

MsgBox Err.Description

End Sub

Private Sub DELYH() On Error GoTo ErrH

Dim rs As New ADODB.Recordset

rs.Open \* from 乘客 where 姓名='\& Trim(MSH.TextMatrix(MSH.RowSel, 0)) & \ If rs.EOF = False Then rs.Delete rs.Update rs.Close

Set rs = Nothing ShowMSH

Command1(1).Enabled = False Command1(2).Enabled = False MsgBox \删除成功!\ Else

rs.Update rs.Close

Set rs = Nothing End If Exit Sub ErrH:

MsgBox Err.Description

End Sub

Private Sub MSH_Click()

If MSH.RowSel >= 1 Then

Text1(0) = MSH.TextMatrix(MSH.RowSel, 0) Text1(1) = MSH.TextMatrix(MSH.RowSel, 1) Combo1 = MSH.TextMatrix(MSH.RowSel, 2)

Command1(1).Enabled = True Command1(2).Enabled = True End If End Sub

站点信息管理

Private Sub ShowMSH()

Dim rs As New ADODB.Recordset rs.Open \站点\

Set MSH.DataSource = rs

MSH.ColWidth(0) = 2500

rs.Close

Set rs = Nothing End Sub

Private Sub Command1_Click(Index As Integer) Select Case Index Case 0 ADDZD Case 1 UPTZD Case 2 DELZD

Case 4 Unload Me End Select End Sub

Private Sub Form_Load() ShowMSH End Sub

Private Sub ADDZD()

联系客服:779662525#qq.com(#替换为@)