Article View: borland.public.cppbuilder.database.ado
Article #3139ftBlob type and TADOStoredProc
From: Jim Young
Date: Sun, 17 Nov 2002 04:11
Date: Sun, 17 Nov 2002 04:11
29 lines
1938 bytes
1938 bytes
Why is it that when creating a parameter for TADOStoredProc of type ftBlob I
can't do:
TADOStoredProc* storedProc = new TADOStoredProc(NULL);
TMemoryStream* ms = new TMemoryStream;
ms->LoadFromFile("somefile.txt");
storedProc->Parameters->CreateParameter("@Data", ftBlob, pdInput, 16, ms);
storedProc->ExecProc();
Instead I have to do:
TADOStoredProc* storedProc = new TADOStoredProc(NULL);
TMemoryStream* ms = new TMemoryStream;
ms->LoadFromFile("somefile.txt");
TParameter* p = storedProc->Parameters->AddParameter();
p->Name = "@Data";
p->Direction = pdInput;
p->LoadFromFile("somefile.txt");
storedProc->ExecProc();
If I use the first example then it generates a runtime exception
"Application uses a value of the wrong type for this application" when
calling CreateParameter. I discovered the method that works by querying
Google. Ironically the article I discovered was for the same problem someone
was having in Delpi, but he codes translates over easily. Is there somewhere
that this is documented for BCB6?
Jim
Technical Details
Message-ID:
<3dd7170b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,fc7d5bf75c00108f,start X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-11-16 20:18:06 PST From: "Jim Young" <jyoung44@hotmail.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: ftBlob type and TADOStoredProc Date: Sat, 16 Nov 2002 20:11:54 -0800 Lines: 34 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 NNTP-Posting-Host: 66.241.84.183 Message-ID: <3dd7170b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1037506315 66.241.84.183 (16 Nov 2002 20:11:55 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail