see code below, i define a temp recset with 'human readable' names, add to it with same names, sort it, but can't seem to find the syntax to refer to them as such when i eventually read it out. i tried field names enclosed in [], etc but not finding it so far, there should be some way, yes?
Code: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 , , adOpenDynamic ****build it****** rs1.Sort = "periods1-5 desc" rs1.MoveFirst Do Until rs1.EOF Debug.Print (rs1.Fields(rs1.Fields.Count - rs1.Fields.Count).Value) Debug.Print (rs1.Fields(rs1.Fields.Count - 4).Value) rpt.WriteLine rs1.Fields(rs1.Fields.Count - rs1.Fields.Count).Value & "," & _ rs1.Fields(rs1.Fields.Count - 4).Value & "," & _ rs1.Fields(rs1.Fields.Count - 3).Value & "," & _ rs1.Fields(rs1.Fields.Count - 2).Value & "," & _ rs1.Fields(rs1.Fields.Count - 1).Value rptCnt = rptCnt + 1 rs1.MoveNext etc




Reply With Quote