本人在用如下的代码对GridData的单元格进行写入的时候,提示.Text为只读,请问如何解决。
Set DataGrid1.DataSource = rsdim i as integer
dim j as integer
j=1
do while not rs.eof
with grid
for i=1 to rs.fields.count-1
.col=i
.row=j
.text="sdfsadfasdf"
next i
end with
rs.movenext
j=j+1
loop
Set DataGrid1.DataSource = rsdim i as integer
dim j as integer
j=1
do while not rs.eof
with grid
for i=1 to rs.fields.count-1
.col=i
.row=j
.text="sdfsadfasdf"
next i
end with
rs.movenext
j=j+1
loop
==>这行不要。
Dim strSql As String
strSql = Trim(Text2.Text) '得到Select语句
ADO_OpenRecordSet(adoConntion, rs, strSql) '得到结果集 If rs.RecordCount = 0 Then
MsgBox "Not Exist Record"
Exit Sub
End IfSet DataGrid1.DataSource = rsdim i as integer
dim j as integer
j=1
do while not rs.eof
with grid
for i=1 to rs.fields.count-1
.col=i
.row=j
.text="sdfsadfasdf"
next i
end withrs.movenextj=j+1loop