数据源
0 1 2 3
3 aa1 aa2 aa3
4 bb1 bb2 bb3数组 tempArr1 = array(0,1,2,3), tempArr2 = Array(0,3,4)aa1对应的X区域是0-3 , 对应的Y区域0-3
aa2 对应的X区域是1-2, 对应的Y区域0-3
aa3的X区域是2-3, 对应的Y区域0-3
.......现在采用方法是数组+SQL+BETWEEN方法。 For ii = 0 To UBound(tempArr1, 2) - 1
For jj = 0 To UBound(tempArr2, 2) - 1
Sql = "Select TextString From [Text$]"
Sql = Sql & " where (InsertPoint0 BETWEEN "
Sql = Sql & tempArr1(0, ii) & " And " & tempArr1(0, ii + 1)
Sql = Sql & ") And (InsertPoint1 BETWEEN "
Sql = Sql & tempArr2(0, jj) & " And " & tempArr2(0, jj + 1) & ") "
Sql = Sql & "And Not IsNull(TextString) Order by InsertPoint1"
'Debug.Print Sql
Set Rst = ConnectRst(Sql)
If Rst.RecordCount > 0 Then
Rst.MoveFirst
tempStr = ""
For kk = 0 To Rst.RecordCount - 2
tempStr = tempStr & Rst.Fields(0) & Chr(10)
Rst.MoveNext
Next kk
tempStr = tempStr & Rst.Fields(0)
Sheet3.Cells(jj + 2, ii + 1) = tempStr
End If
Next jj
Next ii此方法能实现目标需求,但效率低。
请问各位大侠有何高招!谢谢。
0 1 2 3
3 aa1 aa2 aa3
4 bb1 bb2 bb3数组 tempArr1 = array(0,1,2,3), tempArr2 = Array(0,3,4)aa1对应的X区域是0-3 , 对应的Y区域0-3
aa2 对应的X区域是1-2, 对应的Y区域0-3
aa3的X区域是2-3, 对应的Y区域0-3
.......现在采用方法是数组+SQL+BETWEEN方法。 For ii = 0 To UBound(tempArr1, 2) - 1
For jj = 0 To UBound(tempArr2, 2) - 1
Sql = "Select TextString From [Text$]"
Sql = Sql & " where (InsertPoint0 BETWEEN "
Sql = Sql & tempArr1(0, ii) & " And " & tempArr1(0, ii + 1)
Sql = Sql & ") And (InsertPoint1 BETWEEN "
Sql = Sql & tempArr2(0, jj) & " And " & tempArr2(0, jj + 1) & ") "
Sql = Sql & "And Not IsNull(TextString) Order by InsertPoint1"
'Debug.Print Sql
Set Rst = ConnectRst(Sql)
If Rst.RecordCount > 0 Then
Rst.MoveFirst
tempStr = ""
For kk = 0 To Rst.RecordCount - 2
tempStr = tempStr & Rst.Fields(0) & Chr(10)
Rst.MoveNext
Next kk
tempStr = tempStr & Rst.Fields(0)
Sheet3.Cells(jj + 2, ii + 1) = tempStr
End If
Next jj
Next ii此方法能实现目标需求,但效率低。
请问各位大侠有何高招!谢谢。
解决方案 »
- mschart控件 数据过多 导致曲线图显示太紧密看不清楚 [
- Visual Studio下个版本中的Class Designer需要您的建议!
- 摄像头视频流采集和传输---100分求教
- MSDN中错误太多,不知是我的VB6.0有问题,还是MSDN有问题(VB6.0已补钉过),求最新的VB6.0 MSDN
- vb中使用ADO,能不能直接使用ORACLE的事务的命令?
- 我的密码修改了,怎么没有写如数据库啊 !!???
- 关于特色文本框的问题?
- vb里有没有和Delphi中的ScrollBox类似的控件
- 如何在VB中实现调用Excel,并启动相应的宏.
- 请教一个Thread的问题
- 【重要公告】内详...
- 请问这个表格是什么控件?如图
Selece m1(between),m2(between)如何写?请教各位大侠了。谢谢主。
select to_char(sysdate,'yyyymmdd') from dual
dual 是虚表,不存在的表,这样写来测试select 后的字段表达式