🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOCommand and Blob

#629
From: poojo hackma
Date: Wed, 02 Nov 2005 20:33
46 lines
2897 bytes
Foo Tze Wan:

Did you ever get this to work?  I am having a similar problem, and I can not 
find a solution.

I dropped a TADOCommand component onto my form and added these 11 parameters 
to the ADOCommand1->Parameters list:

DataType  Direction  Name  NumericScale  Precision  Size  Value
ftLargeint pdInput   pSP   0             9          0     (Null)
ftString   pdInput   pDe   0             0          50    (Null)
ftLargeint pdInput   pLe   0             9          0     (Null)
ftFloat    pdInput   pRs   10            20         0     (Null)
ftFloat    pdInput   pOs   10            20         0     (Null)
ftFloat    pdInput   pMn   10            20         0     (Null)
ftFloat    pdInput   pMx   10            20         0     (Null)
ftString   pdInput   pUt   0             0          7     (Null)
ftLargeint pdInput   pSp   0             9          0     (Null)
ftLargeint pdInput   pPG   0             9          0     (Null)
ftLargeint pdInput   pBt   0             9          0     (Null)

I have created my INSERT SQL command:

  ADOCommand1->CommandText =
    AnsiString("INSERT INTO SPNs (SPN, Desc, Len, Res, Ofs, ") +
    AnsiString(         "Min, Max, Unit, Sus, PGN, start) ") +
    AnsiString("VALUES (:pSP, :pDe, :pLe, :pRs, :pOs, ") +
    AnsiString(         ":pMn, :pMx, :pUt, :pSp, :pPG, :pBt)");


When I try to assign values to any of my Parameters like this:

  ADOCommand1->Parameters->ParamByName("pSP")->Value = 94;

I get the error: "ADOCommandUser: Parameter 'pSP' not found"

How do I get around this?

Have I set up my parameters incorrectly?

Would it help to set all of the DataTypes to ftVariant?

If I use ftVariant, how do I set up the other Parameter fields to accept 
integers, strings and doubles?

Poojo 
Technical Details
Message-ID: <43692296@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <430aed68@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,221d9548c2024384
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "poojo hackma" <poojo.com/mail>
Newsgroups: borland.public.cppbuilder.database.ado
References: <430aed68@newsgroups.borland.com>
Subject: Re: TADOCommand and Blob
Date: Wed, 2 Nov 2005 14:33:31 -0600
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-Antivirus: avast! (VPS 0544-4, 11/02/2005), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 12.45.133.147
Message-ID: <43692296@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1130963606 12.45.133.147 (2 Nov 2005 12:33:26 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!multikabel.net!feed20.multikabel.net!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail