I'm not sure this is the best solution to your problem, but I would relate your records (A,B,C) to an ID field, then construct the query like this :
<%@ Language=VBScript %><%Dim Con, Rst, actualID, previousID, nextIDSet Con = Server.CreateObject("Adodb.Connection")Con.open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("yourBase.mdb") & ";" Set Rst = Server.CreateObject("ADODB.RecordSet")actualID = 2 'this id is related to field that contains your B recordpreviousID = actualID - 1 'here you look for the previous idnextID = actualID + 1 'here you look for the next idSQL = " SELECT records FROM yourBase WHERE id = '" & previousID & "' OR id = '" & actualID & "' OR id = '" & nextID & "' "Rst.Open sql, ConIf Not Rst.EOF Then Do While Not Rst.EOF Response.Write(Rst("records")) Rst.MoveNext LoopEnd IfRst.CloseSet Rst = NothingCon.CloseSet Con = Nothing%>
Hope this helps,Cheers