Results 1 to 3 of 3

Thread: End of file problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    6

    End of file problem

    Here is my code. It is printing nothing. One of the If condition must be true. It should be either the End of the file(with no records from the stored procedure) or there should be some results.

    set rsDates = Server.CreateObject("ADODB.Recordset")
    rsDates.Open "sp_ReportLastLoadDates " & strParametersList, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText
    if NOT rsDates.EOF then
    Response.Write "you have found some records from database"
    strLoad = rsDates("LoadDate")
    end if


    if rsDates.EOF then
    Response.Write "NO RECORDS FOR DATES FOUND"
    end if


    If i write the folowing lines after my code
    Response.Write "strLoad:" & strLoad & "<br>"

    Then it only prints "strLoad:"


    I also tried running the stored procedure sp_ReportLastLoadDates with passing paraments "strParametersList" in query analyzer and it gives me 1 record back from the database.

    Can someone please explain me what is going on? It should be either end of the file or not the end of the file and it should print either "you have found some records from database" OR "NO RECORDS FOR DATES FOUND". But its printing nothing. Can someone please help me out?
    Last edited by lakhva; Apr 5th, 2005 at 04:11 PM.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: End of file problem

    Is the recordset open after executing the stored procedure? Check it's State property.

    VB Code:
    1. If rsDates.State = 1 Then 'adStateOpen
    2.    if NOT rsDates.EOF then
    3.       Response.Write "you have found some records from database"
    4.       strLoad = rsDates("LoadDate")
    5.    end if
    6.  
    7.    if rsDates.EOF then
    8.      Response.Write "NO RECORDS FOR DATES FOUND"
    9.    end if
    10. Else
    11.      Response.Write "Recordset is not open"
    12. End If

    If the stored procedure contains more than 1 Select statement add a

    Set NoCount On

    to the beginning of the procedure.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    6

    Re: End of file problem

    Hi,

    I restored my development database of the company and made it up-to-date with production database. Development database was pretty outdated and there was error messages mentioned below coming in to our development website on the pages when it was trying to grab data from the database (because of the outdated development database from which its trying to find the data).

    Microsoft VBScript runtime error '800a000d'
    Type mismatch: 'strEndDate'

    Now after I restored this development database, the development website is working fine and there are no error messages. But it’s only my home computer (I work remotely from home) that is still suffering from the above error message whenever I go to view any page involving database interaction.

    I asked 3 other people and they can access development website fine and they can also view all the records perfectly whenever there is database interaction. According to them there is caching or another setting issue with my home computer.

    I use windows 2000. I already tried deleting all the temeroary internet files, history etc.I also changed the setting so that my comptuer doesn't store more than 200 MB cache in memory but that didn't help.Is there some setting i need to change?
    Last edited by lakhva; Apr 5th, 2005 at 04:14 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width