CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: ADO Commands

  1. #1
    Join Date
    Aug 1999
    Posts
    4

    ADO Commands

    Greetings -

    I have a parameterized ADO command. For this project, the command is part of a data environment that I set up.

    I'm having a problem re-running the command with a new parameter. The first time I run it, no problem. The second time I run it (with a new parameter), I get an error along the lines of "this action cannot be completed with an object that's already open." Question is - how do I close it?

    Here's the syntax:

    envDJ.cmdGetOneStudent(temp_id)




    Thanks in advance.


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: ADO Commands

    if your command returns a result set, you should close that after reading all the rows.
    envDJ.cmdGetOneStudent
    do while not envDJ.rscmdGetOneStudent
    ...
    Loop
    envDJ.rscmd...close


  3. #3
    Join Date
    Aug 1999
    Location
    SC, USA
    Posts
    22

    Re: ADO Commands

    Try setting command=nothing.

    John Kisner

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