Results 1 to 4 of 4

Thread: Run-time error 40088, 40008

Hybrid View

  1. #1
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Run-time error 40088, 40008

    if you change it to cn.EstablishConnection rdDriverPrompt and select the driver manually, do you get any errors...
    Quote Originally Posted by hari_vb
    Dim rs, rs1 As rdoResultset
    And you need to change the declaration as in VB you should specify the data type for each variable, so, it should be
    vb Code:
    1. Dim rs As rdoResultset, rs1 As rdoResultset
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  2. #2
    New Member
    Join Date
    Apr 2007
    Posts
    1

    Resolved Re: Run-time error 40088, 40008

    I had something like this happen today. I suddenly started receiving the "No Open Cursor or Cursor Closed" when I tested .EOF after opening a recordset on a stored procedure I was working on.

    In my case, the cause was, I had changed the stored procedure so that it sometimes returned no recordset. Not an EMPTY recordset...no recordset at all. You should re-visit your JP_FIND_STRING stored proc and carefully inspect it to see if there is any way it might exit without returning the results of a SELECT statement. One common way this could happen is if your stored proc has the ability to exit early with just a return code, maybe?

    My stored proc, for example, generates a .CSV file, and I wanted to include a header row in the file...but I didn't want it to return just the header row if there were no result records, so at first I did this:

    IF 1 < (SELECT COUNT(1) FROM @tResults)
    SELECT CombinedLine
    FROM @tResults
    ORDER BY ResultID


    This caused the error message to start appearing whenever there were no results, until I changed it to this:

    SELECT CombinedLine
    FROM @tResults
    WHERE 1 < (SELECT COUNT(1) FROM @tResults)
    ORDER BY ResultID


    which returns an empty recordset, instead of a nonexistent one, if @tResults contains 1 row or less.

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