Results 1 to 2 of 2

Thread: Disconnected Recordsets/Command

  1. #1
    Tall Fat Army
    Guest

    Post Disconnected Recordsets/Command

    Hi,

    I am attempting to use a disconnected recordset with a command object. I wish to:

    Create a Connection object, and set it to open.
    Bind the Connection object to the ActiveConnection property on a Command object.
    Create a recordset and set it to the cursor returned by the Command object's Execute method.

    I want the recordset to be disconnected, so I wish to close the
    connection and pass the recordset back to another function.

    However, when the connection's Close method is called, the recordset cannot work properly. I would set the CursorLocation property on the Recordset first, but it is instantiated by the execute method.

    Does anyone have any ideas on obtaining a disconnected recordset with a command object?

    Cheers,

    TFA

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    Create the recordset, command, and connection objects. Use the connection as the command's activeconnection. Don't create the rs by command.execute - create a new one, set the cursor location to client, and call the rs's open method, passing the command as the first argument, leave out the connection argument, and set the lock and cursor to what you want. Then set the rs's activeconnection to nothing to disconnect it.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

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