setting Stored Procedure Prepared

Posted on 2012-09-15
Last Modified: 2012-09-22
I have recently discovered som errors in my coding concerning the use of the TADOStoredProc component in Borland C++ Builder.
I have in some instances ommitted to do an ADOStoredProc1->Prepared = false before setting the parameters and then doing anADOStoredproc->Pepared = true, prior to executing the stored procedure. This results in un-reliable execution of the stored procedure and I can simply correct this by empoying an ADOStoredProc-.Prepared = false statement.
My question is as follows:
Do I need to set ADOStoredProc->Prepared to false even though I have just set ADOStoredProc->Active to false ?

Question by:alcindor
    LVL 16

    Accepted Solution

    From online help:
    >>An application must set Active to false before changing other properties that affect the status of a database or the controls that display data in an application.

    I believe that answers the question in the most part.
    What this suggests - in my humble oppinion - because I am not expert in the ADO area:
    Set active to false FIRST.
    Set prepared to false.
    Do what you want.
    Set all properties.
    Set active to true.

    George Tokas.
    LVL 2

    Author Closing Comment

    This is as expected, I have only encountered one problem so far but I will review my code and make sure that Active is set to false and thenPrepared to false before doing anything else.

    Best wishes,


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
      Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now