🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3149

Re: SQL Server 7 sp_adduser StoredProc

#3149
From: Jim Young
Date: Thu, 21 Nov 2002 05:52
48 lines
2515 bytes
Here a simple example of using TADOStoredProc and retrieving the result.

    TADOStoredProc *query = new TADOStoredProc(NULL);

    query->Connection = DBConnection;

    query->ProcedureName = "up_mystoredproc";

    query->Parameters->CreateParameter("@Parm1", ftString, pdInput, 4,
str1);
    query->Parameters->CreateParameter("@Parm2", ftInteger, pdInput, 4,
int1);
    query->Parameters->CreateParameter("@Parm2", ftInteger, pdInput, 4,
int2);
    query->Parameters->CreateParameter("@Parm2", ftInteger, pdOutput, 4, 0);

    query->ExecProc();

    return (int) query->Parameters->FindParam("@Result")->Value;


"Stephane Baillargeon" <sbaillargeon@microids.com> wrote in message
news:3ddbb1b4@newsgroups.borland.com...
> I would Like to know how to use a stored procedure with the TADOStoredProc
> Component.  I am familliar with the use of TADOQuery and TADOConnection
but
> the thing that eludes me is the actual binding of parameters within the
> stored proc at runtime.
>
> This stored proc has 4 params:
> RETURN_VALUE
> @loginame
> @name_in_db
> @grpname
>
> I can't quite understand how to work with this stored proc although I have
> read the help files that come with the software (BCB 6 Ent).
>
> If someone would have examples or papers on using this component for sql
> server internal (master) stored procedures, please let me know.
>
> Regards,
>
> Stephane Baillargeon
> Video Game Programmer
> Microids Canada
>
>
Technical Details
Message-ID: <3ddc7489$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!cyclone1.gnilink.net!chi1.webusenet.com!c02.atl3!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3ddbb1b4@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,337a479e55153b3c
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-11-20 22:04:18 PST
From: "Jim Young" <jyoung44@hotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3ddbb1b4@newsgroups.borland.com>
Subject: Re: SQL Server 7 sp_adduser StoredProc
Date: Wed, 20 Nov 2002 21:52:11 -0800
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4920.2300
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300
NNTP-Posting-Host: 66.241.84.183
Message-ID: <3ddc7489$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1037857929 66.241.84.183 (20 Nov 2002 21:52:09 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!cyclone1.gnilink.net!chi1.webusenet.com!c02.atl3!news.webusenet.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail