射雕之陆冠英传下载:在光盘运行代码。老是出现实时错误'91'对象变量或With块变量未设置,错误点在Do While Not mrc.EOF
来源:百度文库 编辑:中科新闻网 时间:2024/05/13 15:19:48
我用的是我用的开发语言是VB,,数据库sever2000。在系统DNS中已经测试数据成功,
在运行的模块的代码是:
Public Sub FormClose()
Unload Me
End Sub
Private Sub ShowData()
Dim j As Integer
Dim i As Integer
Dim MsgText As String
Set mrc = ExecuteSQL(txtSQL, MsgText)
With msgList
.Rows = 1
Do While Not mrc.EOF‘这个就是问题出现的地方
.Rows = .Rows + 1
For i = 1 To mrc.Fields.Count
If Not IsNull(Trim(mrc.Fields(i - 1))) Then
Select Case mrc.Fields(i - 1).Type
Case adDBDate
.TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
Case Else
.TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
End Select
End If
Next i
mrc.MoveNext
Loop
End With
mrc.Close
End Sub
'显示Grid表头
Private Sub ShowTitle()
Dim i As Integer
With msgList
.Cols = 11
.TextMatrix(0, 1) = "编号"
.TextMatrix(0, 2) = "名称"
.TextMatrix(0, 3) = "单位"
.TextMatrix(0, 4) = "类别"
.TextMatrix(0, 5) = "入库价格"
.TextMatrix(0, 6) = "分销价格"
.TextMatrix(0, 7) = "零售价格"
.TextMatrix(0, 8) = "生产厂家"
.TextMatrix(0, 9) = "设置日期"
.TextMatrix(0, 10) = "备注信息"
'固定表头
.FixedRows = 1
'设置各列的对齐方式
For i = 0 To 10
.ColAlignment(i) = 0
Next i
'表头项居中
.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
'设置单元大小
.ColWidth(0) = 1000
.ColWidth(1) = 1000
.ColWidth(2) = 2000
.ColWidth(3) = 1000
.ColWidth(4) = 1000
.ColWidth(5) = 1000
.ColWidth(6) = 1000
.ColWidth(7) = 1000
.ColWidth(8) = 1000
.ColWidth(9) = 1000
.ColWidth(10) = 1000
.Row = 1
End With
End Sub
Private Sub msgList_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
'右键弹出
If Button = 2 And Shift = 0 Then
End If
End Sub
望各位给我这个新手帮忙。谢谢
在运行的模块的代码是:
Public Sub FormClose()
Unload Me
End Sub
Private Sub ShowData()
Dim j As Integer
Dim i As Integer
Dim MsgText As String
Set mrc = ExecuteSQL(txtSQL, MsgText)
With msgList
.Rows = 1
Do While Not mrc.EOF‘这个就是问题出现的地方
.Rows = .Rows + 1
For i = 1 To mrc.Fields.Count
If Not IsNull(Trim(mrc.Fields(i - 1))) Then
Select Case mrc.Fields(i - 1).Type
Case adDBDate
.TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
Case Else
.TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
End Select
End If
Next i
mrc.MoveNext
Loop
End With
mrc.Close
End Sub
'显示Grid表头
Private Sub ShowTitle()
Dim i As Integer
With msgList
.Cols = 11
.TextMatrix(0, 1) = "编号"
.TextMatrix(0, 2) = "名称"
.TextMatrix(0, 3) = "单位"
.TextMatrix(0, 4) = "类别"
.TextMatrix(0, 5) = "入库价格"
.TextMatrix(0, 6) = "分销价格"
.TextMatrix(0, 7) = "零售价格"
.TextMatrix(0, 8) = "生产厂家"
.TextMatrix(0, 9) = "设置日期"
.TextMatrix(0, 10) = "备注信息"
'固定表头
.FixedRows = 1
'设置各列的对齐方式
For i = 0 To 10
.ColAlignment(i) = 0
Next i
'表头项居中
.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
'设置单元大小
.ColWidth(0) = 1000
.ColWidth(1) = 1000
.ColWidth(2) = 2000
.ColWidth(3) = 1000
.ColWidth(4) = 1000
.ColWidth(5) = 1000
.ColWidth(6) = 1000
.ColWidth(7) = 1000
.ColWidth(8) = 1000
.ColWidth(9) = 1000
.ColWidth(10) = 1000
.Row = 1
End With
End Sub
Private Sub msgList_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
'右键弹出
If Button = 2 And Shift = 0 Then
End If
End Sub
望各位给我这个新手帮忙。谢谢
在光盘运行代码。老是出现实时错误'91'对象变量或With块变量未设置,错误点在Do While Not mrc.EOF
VB代码“实时错误:'91'
我在运行程序时老是出现如下错误~~~~~~~~~~~~~~~~~~~~~~~~
帮我看下这段代码,运行出现错误
请问的电脑在运行时老是出现''explorer exe运行出现出现错误,WINDOWS需要关闭''这样的对话框,谢谢
为什么系统老是出现运行期错误
为什么我在浏览网叶时老是出现“出现运行时间错误,是否需要调试”的提示
为什么在QQ空间里操作时老是出现脚本运行错误?应如何避免?
复制光盘文件时出现错误运行页内操作?
开机运行一些启动类型光盘出现错误