'* ************************************** * '* 模块名称:modSort.bas '* 模块功能:使用ADO实现数组排序 '* 作者:http://blog.csdn.net/lyserver '* ************************************** * Sub main() Dim pstr As String pstr = "4aaaa/5.1hhhhhh/1.2pppppp/4.1ttttttt/5.2dddddddd" Dim v As Variant, v_array As Variant, rs As Object v_array = Split(pstr, "/") Set rs = CreateObject("ADODB.Recordset") rs.Fields.Append "zd1", adChar, 100 rs.Open For Each v In v_array rs.AddNew "zd1", v Next rs.Sort = "zd1 ASC" rs.MoveFirst Do While Not rs.EOF Debug.Print rs.AbsolutePosition, , rs!zd1 rs.MoveNext Loop rs.Close End Sub