🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

TADOStoredProc usage

#912
From: mike k
Date: Wed, 02 Mar 2005 01:48
15 lines
1455 bytes
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: <42251b6b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!38.119.100.83.MISMATCH!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,212126262a7bc401,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "mike k" <mknoblock@gmail.com>
Sender: "mike k" <mknoblock@gmail.com>
Reply-To: "mike k" <mknoblock@gmail.com>
Subject: TADOStoredProc usage
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 206.169.248.211     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <42251b6b$1@newsgroups.borland.com>
Date: 1 Mar 2005 17:48:27 -0800
X-Trace: newsgroups.borland.com 1109728107 207.105.83.66 (1 Mar 2005 17:48:27 -0800)
Lines: 16
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!38.119.100.83.MISMATCH!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail