For i = 0 To desc.FieldCount - 1 '将数据集中的数据显示在表格中
Grid1.Rows = dsrows + 1
Grid1.Cols = desc.FieldCount
Grid1.ColWidth(Grid1.Cols - 1) = 1 Grid1.Row = 0
'减去最后一列
Grid1.Col = i
Grid1.Text = desc.FieldName(i)
Rows = Rows + 1
recs.MoveFirst
Do While Not recs.EOF
For k = 0 To desc.FieldCount - 1
k = k + 1
For i = 0 To desc.FieldCount - 1 '将数据集中的数据显示在表格中
Grid1.Rows = dsrows + 1
Grid1.Cols = desc.FieldCount
Grid1.ColWidth(Grid1.Cols - 1) = 1 'FeatureKey列宽为1,不让用户看到 Grid1.Row = 0
'减去最后一列
Grid1.Col = i
Grid1.Text = desc.FieldName(i)
Rows = Rows + 1
recs.MoveFirst
Do While Not recs.EOF
For k = 0 To desc.FieldCount - 1
k = k + 1
Grid1.TextMatrix(k, k) = recs.Fields(desc.FieldName(i)).Value
Next k
recs.MoveNext
Loop
'MsgBox ftr.FeatureKey
Next i = recs.Fields(desc.FieldName(i)).Value
Next k
recs.MoveNext
Loop
Next i请问上面语句有什么问题?显示一个数据没问题,显示多个数据就有问题了,显示"对象变量或者WITH快变量未设置",,,,
Grid1.Rows = dsrows + 1
Grid1.Cols = desc.FieldCount
Grid1.ColWidth(Grid1.Cols - 1) = 1 Grid1.Row = 0
'减去最后一列
Grid1.Col = i
Grid1.Text = desc.FieldName(i)
Rows = Rows + 1
recs.MoveFirst
Do While Not recs.EOF
For k = 0 To desc.FieldCount - 1
k = k + 1
For i = 0 To desc.FieldCount - 1 '将数据集中的数据显示在表格中
Grid1.Rows = dsrows + 1
Grid1.Cols = desc.FieldCount
Grid1.ColWidth(Grid1.Cols - 1) = 1 'FeatureKey列宽为1,不让用户看到 Grid1.Row = 0
'减去最后一列
Grid1.Col = i
Grid1.Text = desc.FieldName(i)
Rows = Rows + 1
recs.MoveFirst
Do While Not recs.EOF
For k = 0 To desc.FieldCount - 1
k = k + 1
Grid1.TextMatrix(k, k) = recs.Fields(desc.FieldName(i)).Value
Next k
recs.MoveNext
Loop
'MsgBox ftr.FeatureKey
Next i = recs.Fields(desc.FieldName(i)).Value
Next k
recs.MoveNext
Loop
Next i请问上面语句有什么问题?显示一个数据没问题,显示多个数据就有问题了,显示"对象变量或者WITH快变量未设置",,,,
解决方案 »
- 怎样为自定义的OCX控件添加一个事件。(为类添加一个事件)
- FTP到某目录,要遍历目录下所有文件并从文件中每行取出数据
- 我是vb学习的新手,谁来帮帮我,做我的老师。先谢了!
- datagrid中cell值
- Format函数的问题
- 如何用默认方式打开指定的文件,如:a.doc,b.xls,c.txt?
- 请问,由于需要把窗体borderstyle设置为0-none后,编译成可执行文件后运行,发现WINDOWS任务栏上没有本程序的名字无法切换,怎么办
- 怎样获取EXE文件的参数
- 如何在vb中建立数据库(SQL SERVER)!
- 谁能介绍几本关于vb script的好书?
- 什么控件可以放动画的Gif呢
- 用msflexgrid显示数据的问题。急!!!!!!!
For i = 0 To 2
Grid1.Rows = dsrows + 1
Grid1.Cols = desc.FieldCount
Grid1.ColWidth(Grid1.Cols - 1) = 1
Grid1.Row = 0
Grid1.Col = i
Grid1.Text = desc.FieldName(i)
Rows = Rows + 1
For k = 0 To desc.FieldCount - 2
Grid1.TextMatrix(i, k) = recs.Fields(desc.FieldName(i)).Value
recs.MoveNext
Next k
Next i
但是只要数据超过K超过5行,就显示超越边界,但是我数据有110行