Access order listing is strange

Results 1 to 2 of 2

Thread: Access order listing is strange

  1. #1
    Jason Guest

    Default Access order listing is strange

    Hi<BR><BR>I have a access db with almost 15 entries holding the following colomns:<BR><BR>mem_id (primary key - non-duplicates not allowed)<BR>name (text)<BR>tag (text)<BR>icq_number (number)<BR>country (text)<BR>function (text)<BR>password (text)<BR>masterkey (just a boolean true/false)<BR><BR>When adding a record on top of the existing ones using code located at bottom it works perfectly but then when I iterate through the recordset for each one and output it the new records dont appear at the bottom as I assumed they would as they have the largest Primary Key (mem_id) but start appearing BETWEEN the 1st one and second one ????????<BR><BR>---------- code to add entry -----<BR>..<BR>..<BR>objRS.MoveLast<BR> Dim textfileinfoname<BR>If IsOkay = "yes" Then <BR><BR> objRS.Addnew<BR><BR> objRS("name") = NewCallsign<BR> objRS("match_tag") = NewMatchTag<BR> objRS("icq_number") = NewIcq<BR> objRS("country") = NewCountry<BR> objRS("function") = NewFunction<BR> objRS("password") = NewPass<BR> objRS("info_filename") = LCase(NewCallsign)<BR> textfileinfoname = LCase(NewCallsign)<BR> <BR> objRS.Update<BR> objRS.Close<BR> Set objConn = nothing<BR> Set objRS = nothing<BR>..<BR>..<BR><BR>-------- End of Add entry code -----------<BR><BR>-------- Start of display entries code -------<BR>..<BR>..<BR>..<BR>Sub writeMembers<BR><BR>Dim objDBaseFile, objRS, strConnect, DBServerPath, objConn, html, incFile<BR>Const adOpenForwardOnly = 0<BR>Const adLockReadOnly = 1<BR>Const adCmdTable = 2<BR>DBServerPath = Server.MapPath("/db/sts/mem_prof/members.mdb")<BR><BR><BR>strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/db/sts/mem_prof/members.mdb") & ";"<BR><BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>Set objRS = Server.CreateObject("ADODB.RecordSet")<BR><BR>objC onn.Open strConnect<BR><BR>objRS.Open "members", objConn, adOpenForwardOnly, adLockReadOnly, adCmdTable<BR><BR>html = ""<BR><BR>While Not objRS.EOF<BR> Call DetFlag(objRS)<BR> Dim filePath<BR> filePath = "/db/sts/mem_prof/" & objRS.Fields("info_filename") & ".txt"<BR> <BR> html = &#039String/HTML concatenation stripped for readability...<BR><BR> Response.Write html <BR> html = ""<BR> html = getInfo(filePath) & "&#060;/td&#062;&#060;/tr&#062;&#060;/table&#062;&#060;/td&#062;&#060;/tr&#062;&#060;/table&#062;<BR><BR>"<BR> Response.Write html<BR> html = ""<BR> objRS.MoveNext<BR> filePath = ""<BR>WEND<BR><BR>&#039Destroy objects<BR>Set objRS = nothing<BR>Set objConn = nothing<BR><BR><BR>End Sub<BR>..<BR>..<BR>..<BR><BR>-------- Start of display entries code -------<BR>Why is it doing this ?<BR><BR>Many Thx<BR>John Cogan

  2. #2
    Join Date
    Dec 1969

    Default RE: Access order listing is strange

    Because you did not specify any sort order when you created your recordset. Instead of simply opening "members", open "select * from members order by mem_id"<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts