Article View: borland.public.cppbuilder.database.ado
Article #913Re: TADOStoredProc usage
From: MikeKnoblock
Date: Wed, 02 Mar 2005 02:07
Date: Wed, 02 Mar 2005 02:07
25 lines
1883 bytes
1883 bytes
I should add: there is an active TADOConnection component that is actively connected to the DB at runtime, and this is associated with the TADOStoredProcedure (at runtime). so: sp->Connection = DM->ADO_CFG; is implied. mike k wrote: > Can anyone tell me how to call a SQL Server stored procedure with parameters? I tried this: > > TADOStoreProc *sp = StoredProc1; > sp->Active = false; > sp->ProcedureName="SP1"; > sp->Parameters->Items[0]->DataType = ftWord; > sp->Parameters->Items[1]->Value = 1; > sp->Active = true; > > this only works if I already have the storedproc component on a Data Module at design time, loaded with the right ProcedureName. If I want to do this completely on the fly (the server has hundreds of stored procedures, all with different types of parameters) it bombs when I try to assign the parameters. What am I leaving out? > > tia > > Mike >
Technical Details
Message-ID:
<42251FC8.6090503@gmail.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<42251b6b$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,212126262a7bc401 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit Message-ID: <42251FC8.6090503@gmail.com> Date: Tue, 01 Mar 2005 18:07:04 -0800 From: MikeKnoblock <mknoblock@gmail.com> User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.database.ado To: mike k <mknoblock@gmail.com> Subject: Re: TADOStoredProc usage References: <42251b6b$1@newsgroups.borland.com> In-Reply-To: <42251b6b$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 206.169.248.211 X-Trace: newsgroups.borland.com 1109729224 206.169.248.211 (1 Mar 2005 18:07:04 -0800) Lines: 25 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail