大家好,欢迎来到IT知识分享网。
前提
刚刚敲代码时,出现了30009的错误,后来找出问题竟然发现只是少了一个S
温习知识
出现问题
解决方法
If Not IsNumeric(Trim(txtcardno.Text)) Then MsgBox "请输入数字", 0 + 48, "提示" txtcardno.Text = "" txtcardno.SetFocus Exit Sub End If txtsql = "select * from line_info where cardno = '" & Trim(txtcardno.Text) & "'" Set mrc = ExecuteSQL(txtsql, msgtext) If mrc.EOF = True Then MsgBox "卡号不存在,请重新输入", 0 + 48, "提示" txtcardno.Text = "" txtcardno.SetFocus Exit Sub End If With myFlexGrid1 .Rows = 1 *'把Row改成Rows就行了* .CellAlignment = 4 .TextMatrix(0, 0) = "卡号" .TextMatrix(0, 1) = "姓名" .TextMatrix(0, 2) = "上机日期" .TextMatrix(0, 3) = "上机时间" .TextMatrix(0, 4) = "下机日期" .TextMatrix(0, 5) = "下机时间" .TextMatrix(0, 6) = "消费金额" .TextMatrix(0, 7) = "余额" .TextMatrix(0, 8) = "备注" Do While Not mrc.EOF .Rows = .Rows + 1 .CellAlignment = 4 .TextMatrix(.Rows - 1, 0) = mrc.Fields(1) .TextMatrix(.Rows - 1, 1) = mrc.Fields(3) .TextMatrix(.Rows - 1, 2) = mrc.Fields(6) .TextMatrix(.Rows - 1, 3) = mrc.Fields(7) .TextMatrix(.Rows - 1, 4) = mrc.Fields(8) & "" .TextMatrix(.Rows - 1, 5) = mrc.Fields(9) & "" .TextMatrix(.Rows - 1, 6) = mrc.Fields(11) & "" .TextMatrix(.Rows - 1, 7) = mrc.Fields(12) & "" .TextMatrix(.Rows - 1, 8) = mrc.Fields(13) & "" '移动到下一条记录 mrc.MoveNext Loop End With mrc.Close End Sub
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/134845.html