Article View: borland.public.cppbuilder.database.ado
Article #4573Re: How to set parameters for TADOStoredProc?
From: Graham Reeds
Date: Mon, 03 Dec 2001 10:36
Date: Mon, 03 Dec 2001 10:36
50 lines
2319 bytes
2319 bytes
"sstar" <s142857@21cn.com> wrote in message news:3c061130$1_2@dnews...
> My procedure is as below:
> CREATE OR REPLACE PROCEDURE BillLogin(
> sProvider OUT Admins.provider_no %TYPE)
> AS
> BEGIN
> SELECT provider_no
> INTO sProvider
> FROM Admins
> WHERE admin_id = 'test'
> END;
>
> I'm sure the result is one row only
>
> My codes are as below:
> if(!ADOConnection1->Connected)
> {
> this->ADOConnection1->Open();
> }
> ADOStoredProc1->ProcedureName = "BillLogin";
>
> ADOStoredProc1->Parameters->Clear();
> ADOStoredProc1->Parameters->AddParameter();
> ADOStoredProc1->Parameters->Items[0]->DataType = ftString;
> ADOStoredProc1->Parameters->Items[0]->Direction = pdOutput;
> ADOStoredProc1->Parameters->Items[0]->Name = "sProvider";
>
> ADOStoredProc1->ExecProc();
> Edit1->Text = VarToStr(ADOStoredProc1->Parameters->Items[0]->Value);
>
>
> When I run the exe file, I receive error message:
> "Parameter object is defined incorrectly. Inconsistant or incompleted
> information is provided."
>
>
> Can anyone tell me how to set patameters for TADOStoredProc?
I was wrestling with TADOStoredProc for a few days and the solution provided
by Arnie Mauer was to use TADOQuery something like "BEGIN MyProc( parm1,
parm2, etc ); END;". See the thread "Incorrect documentation for
TADOStoredProc" from the 22/11/01.
HTH
--
Yours faithfully, Graham Reeds.
grahamr@omnieng.co.uk | http://omnieng.co.uk/
Technical Details
Message-ID:
<3c0b55a8_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3c061130$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,abbdc80ef399d86b X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-12-03 02:38:32 PST From: "Graham Reeds" <grahamr@omnieng.co.uk> Newsgroups: borland.public.cppbuilder.database.ado References: <3c061130$1_2@dnews> Subject: Re: How to set parameters for TADOStoredProc? Date: Mon, 3 Dec 2001 10:36:18 -0000 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 212.172.148.2 Message-ID: <3c0b55a8_1@dnews> X-Trace: dnews 1007375784 212.172.148.2 (3 Dec 2001 02:36:24 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews