Can't select First record

Results 1 to 2 of 2

Thread: Can't select First record

  1. #1
    Join Date
    Dec 1969

    Default Can't select First record

    specs:<BR><BR>SQL 7.0<BR><BR>Using the following code the ASP-page refuses to show the First record, what am I missing here ? It constantly shows the second record<BR><BR>&#060;%@ Language=VBScript %&#062;<BR> &#060;% Option Explicit %&#062;<BR> &#060;!--#INCLUDE File="" --&#062;<BR>&#060;% <BR> <BR> Dim objConn, objRSPoll, objRSPollOption, strSQLPoll, strSQLPollOption, Stelling, DateStart, DateEnd, PollIDNow, iLoop, iCount<BR> <BR> makeConnection()<BR> createPollRecordSet()<BR> getFirstRecord()<BR> retrieveData()<BR> createHeader() <BR> createPollOptionRecordSet()<BR> createOptions()<BR> createButtons()<BR> createFooter()<BR><BR>Sub makeConnection<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.Open "bctestdb","sa",""<BR> Set Session("MyDB_conn") = objConn<BR>End Sub<BR><BR><BR>Sub createPollRecordSet<BR> &#039Create our Poll recordset object<BR> Set objRSPoll = Server.CreateObject("ADODB.Recordset")<BR> strSQLPoll = "SELECT * FROM Poll;"<BR> Set objRSPoll = objConn.Execute(strSQLPoll, adOpenStatic, adLockReadOnly)<BR>End Sub<BR><BR><BR>Sub getFirstRecord<BR> objRSPoll.MoveFirst<BR>End Sub<BR><BR>Sub createPollOptionRecordSet<BR> Response.write(PollIDNow)<BR> &#039Create our PollOption recordset object<BR> Set objRSPollOption = Server.CreateObject("ADODB.Recordset")<BR> strSQLPollOption = "SELECT * FROM PollOption Where PollOption.PollID = &#039" & PollIDNow & "&#039;"<BR> Set objRSPollOption = objConn.Execute(strSQLPollOption)<BR>End Sub<BR><BR><BR>Sub retrieveData <BR> objRSPoll.movenext<BR> Stelling = objRSPoll("PollQuestion")<BR> DateStart = objRSPoll("DateStart")<BR> DateEnd = objRSPoll("DateEnd")<BR> PollIDNow = objRSPoll("POLLID")<BR> Response.write(PollIDNow)<BR>End Sub

  2. #2
    Smitty Guest

    Default RE: Can't select First record

    In the RetrieveData routine move the objRSPoll.movenext before the End Sub

Posting Permissions

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