Returning select statement from sproc

  • Hi everyone,

    Hope u are all ok, got a bit of a question.

    We have all our website connections setup as ODBC but have now changed them to OLEDB connections.  Everything seems ok, but i am getting an error with a sproc that returns a select statement, it says the field is not valid, but it is definetly there.

    Can anyone tell me if there is anything that you have to code different when using OLEDB instead of ODBC??

    Thanks everyone

  • Can you please paste the full error here so that it will be easy for all of us




    My Blog: http://dineshasanka.spaces.live.com/

  • No probs, here is the error.

    Com Error No. = -2146824584

    Description = Operation is not allowed when the object is closed.

    This refers to the line where i do "If Not (RS.EOF And RS.BOF) Then".

     

    On another page, where i return a select statement made up of variables.

    i.e. Select @NoOfPage As NoOfPage, @NoOfTitles As NoOfTitles

    I get the following error when accessing the value

    Com Error No. = 2146825023

    Description = Item cannot be found in the collection corresponding to the requested name or ordinal.

    On my asp page all i am doing is

    Title = RS.Fields.Item("NoOfTitles").Value

     

    I have now changed the connection back to ODBC and everything works, so how can i get it to work with OLE??

    Thanks everyone is advanced!

  • Please post the full code, those error make no sense together.

  • Thanks for your help, but i have found out how to fix it now.

    If anyone else has the problem, then include the following line of code after the AS keyword after defining input variables in your sproc

    SET NOCOUNT ON

    Thanks everyone

  • Are you using .NET?

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply