标题:[MSFlexGrid1.Text = rs.Fields(j).Value 有错
取消只看楼主
yuxin1382
Rank: 1
等 级:新手上路
帖 子:172
专家分:0
注 册:2006-12-8
结帖率:50%
 问题点数:0 回复次数:5 
[MSFlexGrid1.Text = rs.Fields(j).Value 有错

Dim sql As String

Dim i As Integer

Dim j As Integer
Call opensjk

sql = "select * from yhda "

rs.Open sql, sjk, 1, 1

MSFlexGrid1.Rows = rs.RecordCount - 1

MSFlexGrid1.Cols = rs.Fields.Count

For i = 1 To rs.RecordCount - 1

MSFlexGrid1.Rows = i

For j = 0 To rs.Fields.Count
MSFlexGrid1.Cols = j
MSFlexGrid1.Text = rs.Fields(j).Value

Next j
以上提示 MSFlexGrid1.Text = rs.Fields(j).Value 有错,不知这样写有没有问题啊。

搜索更多相关主题的帖子: Value Fields 
2007-09-17 10:39
yuxin1382
Rank: 1
等 级:新手上路
帖 子:172
专家分:0
注 册:2006-12-8
得分:0 
还是不行啊。
2007-09-17 10:59
yuxin1382
Rank: 1
等 级:新手上路
帖 子:172
专家分:0
注 册:2006-12-8
得分:0 
MSFlexGrid1.TextMatrix(i,j)=rs.Fields(j).Value

我知道啊,我改的是这样啊,不行啊。
2007-09-17 11:07
yuxin1382
Rank: 1
等 级:新手上路
帖 子:172
专家分:0
注 册:2006-12-8
得分:0 

改了,可是现在提示MSFlexGrid1.Rows = rs.RecordCount - 1 错误,对像不可操作

2007-09-17 11:15
yuxin1382
Rank: 1
等 级:新手上路
帖 子:172
专家分:0
注 册:2006-12-8
得分:0 

Dim sql As String

Dim i As Integer

Dim j As Integer
Call opensjk

sql = "select * from yhda "

rs.Open sql, sjk, 1, 1

MSFlexGrid1.Rows = rs.RecordCount + 1

MSFlexGrid1.Cols = rs.Fields.Count+1

For i = 1 To rs.RecordCount + 1

MSFlexGrid1.Rows = i+1

For j = 0 To rs.Fields.Count+1

MSFlexGrid1.Text = rs.Fields(j).Value

Next j

提示MSFlexGrid1.Rows = rs.RecordCount + 1对像不可操作

2007-09-17 11:19
yuxin1382
Rank: 1
等 级:新手上路
帖 子:172
专家分:0
注 册:2006-12-8
得分:0 
不好意思,初学者,麻烦各位了啊
2007-09-17 11:21



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-170532-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.113394 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved