-
sort recordset
its not exactly database, but is manipulating an ado recordset.
i create a rs, populate it and never save it to db, it is used for work only.
after populating it i want to sort it but the sort isn't working
the debugger doesn't complain about the sort stmt but it doesn't sort it???
would it be easier/more expedient to try and open it ordering it?
Code:
rs1.CursorLocation = adUseClient
Set rs1 = New ADODB.Recordset
With rs1.Fields
.Append "url", adChar, 50
.Append "periods1-5", adDouble
.Append "periods2-6", adDouble
.Append "periods3-7", adDouble
.Append "reach", adInteger
End With
rs1.Open
++later in program+++
With rs1
.AddNew
![url] = rs.Fields(rs.Fields.Count - rs.Fields.Count).Value
![periods1-5] = calc1Value
![periods2-6] = calc2Value
![periods3-7] = calc3Value
![reach] = rs.Fields(rs.Fields.Count - 1).Value
.Update
End With
++later in program+++
rs1.Sort = "periods1-5"
rs1.MoveFirst
Do Until rs1.EOF
Debug.Print (rs1.Fields(rs1.Fields.Count - rs1.Fields.Count).Value)
etc
-
Re: sort recordset
try
rs1.Sort = "[periods1-5]"
-tg