Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdInquire_Click()
Dim txtSQL As String
Dim MsgText As String
Dim mrc As ADODB.Recordset
txtSQL = "select * from student_Info where SID= '" & TxtSID.Text & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
With myflexgrid
.Rows = 2
.CellAlignment = 4
.TextMatrix(1, 0) = "学号"
.TextMatrix(1, 1) = "姓名"
.TextMatrix(1, 2) = "性别"
.TextMatrix(1, 3) = "出生日期"
.TextMatrix(1, 4) = "班号"
.TextMatrix(1, 5) = "联系电话"
Do While Not mrc.EOF
.Rows = .Rows + 1
.CellAlignment = 4
.TextMatrix(.Rows - 1, 0) = mrc.Fields(0)
.TextMatrix(.Rows - 1, 1) = mrc.Fields(1)
.TextMatrix(.Rows - 1, 2) = mrc.Fields(2)
.TextMatrix(.Rows - 1, 3) = Format(mrc.Fields(3), "yyyy-mm-dd")
.TextMatrix(.Rows - 1, 4) = mrc.Fields(4)
.TextMatrix(.Rows - 1, 5) = mrc.Fields(5)
mrc.MoveNext
Loop
End With
mrc.Close
End Sub
Private Sub Form_Load()
With myflexgrid
.CellAlignment = 4
.TextMatrix(1, 0) = "学号"
.TextMatrix(1, 1) = "姓名"
.TextMatrix(1, 2) = "性别"
.TextMatrix(1, 3) = "出生日期"
.TextMatrix(1, 4) = "班号"
.TextMatrix(1, 5) = "联系电话"
End With
End Sub
运行到Do While Not mrc.EOF 实时错误91
别人那儿都是对的,可我这儿就错了
|