想为动态集adodb.recordset创建索引,请问该如何操作?
代码如下:
Sub alarm_find()
Dim rs_z As New ADODB.Recordset
Dim sql_z As String
Dim idx_z As New Index
sql_z = " select c.厂家标识,c.地市,c.告警标题 as 主要告警,c.告警对象名称_S,c.告警发生时间 as 主要告警时间 from 告警详表 as c"
Set rs_z = New ADODB.Recordset
Set rs_z = CurrentDb.OpenRecordset("sql_z")
With rs_z
.Index = "idx_z"
End With
End Sub
tmtony 发表于 2016-3-28 10:13
动态创建索引要用到ADOX
可参考这里的代码
http://www.office-cn.net/t/ado/index.html?htm_admscindexcr ...
tmtony 发表于 2016-3-28 10:13
动态创建索引要用到ADOX
可参考这里的代码
http://www.office-cn.net/t/ado/index.html?htm_admscindexcr ...
tmtony 发表于 2016-3-28 10:13
动态创建索引要用到ADOX
可参考这里的代码
http://www.office-cn.net/t/ado/index.html?htm_admscindexcr ...
魔天天自在 发表于 2016-3-28 11:25
是要将 recordset的内容赋值给某张表再进行操作吗
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) | Powered by Discuz! X3.3 |