|
为什么在记录集recordset中无法使用sort属性排序? 是我用了联合(union)语句了吗? 如要对下文的rs记录集进行排序应通过什么方式? 谢谢!
Sub aa()
Dim sqlstr As String
Dim rs As New ADODB.Recordset
sqlstr = "SELECT 准考证号,考点名称,姓名,总分,'计算机应用基础' as mm FROM dbo_1 " & _
" union " & _
"SELECT 准考证号,考点名称,姓名,总分,'计算机应用基础' as mm FROM dbo_2 " & _
" union " & _
"SELECT 准考证号,考点名称,姓名,总分,'计算机应用基础' as mm FROM dbo_4 " & _
" union " & _
"SELECT 准考证号,考点名称,姓名,总分,'会计电算化' as mm FROM dbo_3 "
rs.CursorLocation = adUseClient
Set rs = getrs(sqlstr)
rs.sort = "mm ASC"
End Sub
注1)设置了rs.CursorLocation = adUseClient与没设置在access中都不行,access提示我说"当前程序不支持排序或过虑所必需的界面",是access本来就没有吗?
(2)我的access数据库中的表为sql server链接到access中的表
|
|