Database Help

Results 1 to 2 of 2

Thread: Database Help

  1. #1
    pnub Guest

    Default Database Help

    I am still having a problem traversing backwards through a database. What am I doing wrong in the following code:<BR><BR>&#060;%<BR> Dim DB_CONNECTSTRING, objRecordset<BR> DB_CONNECTIONSTRING = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("guestbook.mdb") & ";"<BR>&#037;&#062;<BR>&#060;!-- #INCLUDE VIRTUAL="/include/adovbs.inc" --><BR>&#060;%<BR> Set objRecordset = Server.CreateObject("ADODB.Recordset")<BR> objRecordset.Open "guestbook", DB_CONNECTIONSTRING, adOpenStatic, adLockPessimistic, adCmdTable<BR>&#037;&#062;<BR><BR>&#060;%<BR> objRecordset.MoveLast<BR> Do While Not objRecordset.BOF<BR> Response.Write objRecordset.Fields("name") & "<BR>" & vbCrLf<BR> Response.Write objRecordset.Fields("email") & "<BR>" & vbCrLf<BR> Response.Write objRecordset.Fields("url") & "<BR>" & vbCrLf<BR> Response.Write objRecordset.Fields("message") & "<BR><BR>" & vbCrLf<BR> objRecordset.MovePrev<BR> Loop<BR> objRecordset.Close<BR> Set objRecordset = Nothing<BR>&#037;&#062;

  2. #2
    Join Date
    Dec 1969
    Posts
    1,315

    Default RE: Database Help

    The correct one is: objRecordset.MovePrevious <BR>instead of objRecordset.MovePrev<BR><BR>hope that will work.<BR><BR>John Weeflaar

Posting Permissions

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