CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 1999
    Location
    Bolton/England
    Posts
    7

    How to govern what type of recordset is returned from a SQL stored procedure?

    I have created an ODBC connection and run a SQL stored procedure name. It seems as though the only type of recordset that it returns from a stored procedure is a 'forward-only' type.

    Dim rsTemp as Recordset
    Set rsTemp=Connection.Openrecordset("myprocedure",dbOpendynamic)

    (although in this case I want the dynamic type recordset)

    The strange thing is, if I substituted the procedure name "myprocedure" with straighforward SQL syntax, it has no problem returning my the recordset of my choice

    How do I control what type of recordset is returned from calling a SQL stored procedure ?

    Thankyou if you can help

    Keith



  2. #2
    Join Date
    Oct 1999
    Posts
    12

    Re: How to govern what type of recordset is returned from a SQL stored procedure?

    The following is from the ADO documentation regarding using a connection or command object to open a recordset:

    The returned Recordset object is always a read-only, forward-only cursor. If you need a Recordset object with more functionality, first create a Recordset object with the desired property settings, then use the Recordset object's Open method to execute the query and return the desired cursor type.

    Good Luck,
    Roy


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

Featured