Click here to Skip to main content
15,889,992 members
Articles / Database Development / SQL Server
Article

Stored Procedure Class Wizard (SPCW)

Rate me:
Please Sign up or sign in to vote.
4.76/5 (15 votes)
8 May 2001 185.6K   3.2K   50   21
A tool to generate class files to implement stored procedures
  • Download executable - 265 Kb
  • Download source - 103 Kb
  • Description

    Stored Procedure Class Wizard (SPCW) is a development tool that can be used exclusively to generate class files (.cpp and .h) derived from MFC’s CRecordset for stored procedures. Currently SPCW supports Microsoft SQL Server 7.0/6.5, and Sybase SQL Anywhere 5.5 and can be extended to any database. The idea is to speed up the development process of client-server projects involving aforementioned packages under Windows NT/9x. SPCW is an extension to Microsoft Visual Studio's class wizard.

    Running the application:

    Extract it to a <\temp> folder and then run.

    System Requirements:

    Microsoft Visual C++ 5.0 (and above), Windows NT 4.0/9x (using the latest service packs is highly recommended).

    History

    9 April 2001 - Fixed data trunctation problem and Output params buffer now released correctly (Justin Kirby)

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    Written By
    United States United States
    This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

    Comments and Discussions

     
    QuestionGreat Work Pin
    vaibhavbvp30-Jun-13 18:15
    vaibhavbvp30-Jun-13 18:15 
    GeneralThanks Pin
    n1k025-Mar-09 21:15
    n1k025-Mar-09 21:15 
    GeneralThank you!! Pin
    e_pech22-Apr-08 9:37
    e_pech22-Apr-08 9:37 
    GeneralThanks! Pin
    PhilWelch18-Oct-07 4:46
    PhilWelch18-Oct-07 4:46 
    QuestionHow to set input parameter to stored proc? Pin
    bag_18-Mar-07 9:17
    bag_18-Mar-07 9:17 
    GeneralProblem in giving alias Pin
    Naresh200724-Feb-07 1:35
    Naresh200724-Feb-07 1:35 
    QuestionHaving a couple of issues Pin
    conacher1-Jan-06 14:40
    conacher1-Jan-06 14:40 
    I have used this package to create a bunch of classes, but a couple of my stored procedures simply won't work.
    I receive the following error message when I try to create a class for the SP appearing below the error.

    Any suggestions from anyone would be appreciated. (Maybe there is an updated version?)

    Error message:
    Expected error 16 from application Stored Procedure Class Wizard............

    Stored Procedure
    CREATE PROCEDURE dbo.procDeleteDoctorInformation
    @lReturnCode int OUTPUT, /* Return Code Value */
    @lDoctorIDNumber int OUTPUT, /* Doctor Identifier */
    @lDoctorPatientCount int OUTPUT /* Doctor Patient Counter */
    AS

    /*sp_Audit_Agent Setup Begin */
    DECLARE @ErrorNo int
    ,@Procedure_Name varchar(30)
    ,@ErrorFlag int
    ,@ErrorMsg varchar(255)
    ,@RowCount int

    /* Set the procedure name in the variable. */
    SELECT @Procedure_Name = OBJECT_NAME (@@PROCID)
    /* Set the @ErrorFlag variable to -1 as the default return value. */
    SELECT @ErrorFlag = -1
    /*sp_Audit_Agent Setup End*/

    SELECT @lDoctorPatientCount = COUNT(Clinic.dbo.tblPatientBiographical.lPatientIDNumber)
    FROM Clinic.dbo.tblPatientBiographical
    WHERE tblPatientBiographical.lDoctorIDNumber = @lDoctorIDNumber

    SELECT @ErrorNo = @@ERROR, @RowCount = @@ROWCOUNT
    IF @ErrorNo <> 0
    BEGIN
    Select @ErrorMsg = 'SELECT Error,procDeleteDoctorInformation'
    EXEC sp_Audit_Agent @UnexpectedError = 0, @Code = 16, @Text = @ErrorMsg, @Component = 'StoredProcedure', @Module = @Procedure_Name

    RAISERROR('Cannot retrieve the Patient Count for the Doctor.',16,1)
    SELECT @lReturnCode = -1
    RETURN(@ErrorNo)
    END

    IF @lDoctorPatientCount <> 0
    BEGIN
    Select @ErrorMsg = 'SELECT Error,procDeleteDoctorInformation'
    EXEC sp_Audit_Agent @UnexpectedError = 0, @Code = 16, @Text = @ErrorMsg, @Component = 'StoredProcedure', @Module = @Procedure_Name

    RAISERROR('The Patient Count for this Doctor is NOT Zero, so we cannot delete.',16,1)
    SELECT @lReturnCode = -2
    RETURN(@ErrorNo)
    END



    DELETE FROM Clinic.dbo.tblDoctor
    WHERE tblDoctor.lDoctorIDNumber = @lDoctorIDNumber;

    SELECT @ErrorNo = @@ERROR, @RowCount = @@ROWCOUNT

    /* PRINT 'After DELETE Based on Doctor ID @ErrorNo = ' + ltrim(str(@ErrorNo)) + ' @RowCount = ' + ltrim(str(@RowCount)) */
    IF @RowCount > 0
    SELECT @ErrorFlag = 0
    ELSE
    BEGIN
    Select @ErrorMsg = 'SELECT Error,procDeleteDoctorInformation'
    EXEC sp_Audit_Agent @UnexpectedError = 0, @Code = 16, @Text = @ErrorMsg, @Component = 'StoredProcedure', @Module = @Procedure_Name

    RAISERROR('Cannot Delete the Doctor Information.',16,1)
    SELECT @ErrorFlag = -3
    END

    SELECT @lReturnCode = @ErrorFlag
    RETURN(@ErrorNo)
    GO


    Thanks for any and all responses.
    GeneralYou're the Man !! Pin
    WREY2-Oct-04 8:58
    WREY2-Oct-04 8:58 
    GeneralRetrieve data with stored procedure on C#.Net Pin
    ASP application forms connection with Database17-Jun-04 0:18
    ASP application forms connection with Database17-Jun-04 0:18 
    GeneralThanks Pin
    maxiberta23-Sep-03 10:14
    maxiberta23-Sep-03 10:14 
    Generalnice tools Pin
    Member 39740517-Jun-03 20:40
    Member 39740517-Jun-03 20:40 
    GeneralI love you Pin
    mikeperetz29-Mar-03 4:25
    mikeperetz29-Mar-03 4:25 
    QuestionHow to open and use. Pin
    prashmit4-Mar-03 1:49
    prashmit4-Mar-03 1:49 
    AnswerRe: How to open and use. Pin
    kbajan17-Feb-05 6:27
    kbajan17-Feb-05 6:27 
    AnswerRe: How to open and use. Pin
    daleboy7-Oct-05 21:54
    daleboy7-Oct-05 21:54 
    GeneralThanks a lot Pin
    jack Mesic13-Apr-02 16:50
    jack Mesic13-Apr-02 16:50 
    GeneralThank you Pin
    1-May-01 9:38
    suss1-May-01 9:38 
    GeneralCLongBinary parameters are not supported. Pin
    13-Dec-00 16:00
    suss13-Dec-00 16:00 
    QuestionHow can I use this nice class generator for getting input or/and output parameters? Pin
    13-Dec-00 0:57
    suss13-Dec-00 0:57 
    Generalnewby thanks you, this is awesome Pin
    11-Nov-00 14:32
    suss11-Nov-00 14:32 
    GeneralVery nice tool Pin
    flyingfox8-Jun-00 16:45
    flyingfox8-Jun-00 16:45 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.