Private Sub SearchColumns()
Dim oRS As ADODB.Recordset
Dim fld As Field
Dim oRead As New CCustomReportRead
Dim nIndex As Integer
Dim sName As String
nIndex = 1
Set oRS = oRead.GetBlocksList("1=2")
If oRS Is Nothing Then
Alert "Database Error!"
PutToLog "Failed While Get Block List", "frmSheet"
Exit Sub
End If
With grd
For Each fld In oRS.Fields
sName = Trim(fld.Name)
If sName <> "" Then
.Cols = grd.Cols + 1
.TextMatrix(0, nIndex) = sName
.ColWidth(nIndex) = Len(sName) * 150 + 240
nIndex = nIndex + 1
End If
Next
.Cols = .Cols - 1
.ColWidth(0) = 0
End With
Set oRS = Nothing
Set oRead = Nothing
Set fld = Nothing
End Sub
Dim oRS As ADODB.Recordset
Dim fld As Field
Dim oRead As New CCustomReportRead
Dim nIndex As Integer
Dim sName As String
nIndex = 1
Set oRS = oRead.GetBlocksList("1=2")
If oRS Is Nothing Then
Alert "Database Error!"
PutToLog "Failed While Get Block List", "frmSheet"
Exit Sub
End If
With grd
For Each fld In oRS.Fields
sName = Trim(fld.Name)
If sName <> "" Then
.Cols = grd.Cols + 1
.TextMatrix(0, nIndex) = sName
.ColWidth(nIndex) = Len(sName) * 150 + 240
nIndex = nIndex + 1
End If
Next
.Cols = .Cols - 1
.ColWidth(0) = 0
End With
Set oRS = Nothing
Set oRead = Nothing
Set fld = Nothing
End Sub
解决方案 »
- 请教一个输出字符串的问题。新手求教!谢谢!
- 晚上好啊,吃晚饭来看研究下窗体刷新问题!
- 求VB 打印控件制作
- Dll & MDIForm 問題,Up有份
- 怎么才能使DataRepeater控件更新数据
- Access中有没有存储过程?多谢大哥相救,万福金安,小女子有礼了!
- 组件技术开发网站的朋友进来讨论
- ActiveX DLL问题
- 输入分钟显示小时用什么涵数?忘记了,快?
- 请问那位兄台知道那有ASP加密、编译的程序?给100分
- VB中如何实现播放DVD歌曲?
- 1、如何在VB中调用汇编伪代码,也就是说把汇编代码在VB中使用,以防GEBUG破译? 2、哪位有缘仁兄相送一个“圆形按钮”的CTL源代码,我将
就是表中的字段名