🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to set parameters for TADOStoredProc?

#4497
From: sstar
Date: Mon, 10 Dec 2001 03:34
63 lines
2606 bytes
Thank you.
I set enough size for the parameter and then the exception does not appear again.

ADOStoredProc1->Parameters->Items[0]->Size = [a value not short than the column's size];


Thanks again.


"Graham Reeds" <grahamr@omnieng.co.uk> wrote:
>
>"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: <3c142d2e$1_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!dnews
References: <3c061130$1_2@dnews> <3c0b55a8_1@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-09 19:46:24 PST
From: "sstar" <s142857@21cn.com>
Sender: "sstar" <s142857@21cn.com>
Reply-To: "sstar" <s142857@21cn.com>
Subject: Re: How to set parameters for TADOStoredProc?
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 203.93.240.102 203.93.240.102    
References: <3c061130$1_2@dnews>  <3c0b55a8_1@dnews> 
NNTP-Posting-Host: 207.105.83.65
Message-ID: <3c142d2e$1_1@dnews>
Date: 9 Dec 2001 19:34:06 -0800
X-Trace: dnews 1007955246 207.105.83.65 (9 Dec 2001 19:34:06 -0800)
Lines: 64
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