Article View: borland.public.cppbuilder.database.ado
Article #893Re: ADO ParamByName I just don't get.
From: Arnie
Date: Fri, 25 Feb 2005 14:17
Date: Fri, 25 Feb 2005 14:17
44 lines
2157 bytes
2157 bytes
"bmkiss" <bmkiss67@cablespeed.com> wrote in message
news:421e146a$1@newsgroups.borland.com...
> I'm trying to convert from BDE to ADO. I don't know much about ADO so I
> hope this isn't completely stupid. The chunk of code below doesn't work.
> I
> get the following error stepping thru the code.
>
> ---------------------------
>
> Debugger Exception Notification
>
> ---------------------------
>
> Project COBB.exe raised exception class EOleException with message
> 'Application uses a value of the wrong type for the current operation'.
> Process stopped. Use Step or Run to continue.
>
> ---------------------------
>
> OK Help
>
> ---------------------------
>
>
>
> ADOqSuggestions->Close();
>
> ADOqSuggestions->SQL->Clear();
>
> ADOqSuggestions->SQL->Add("Insert into Suggestions
> values(:name,:phone,:email,:sub,");
>
> ADOqSuggestions->SQL->Add(":sug,:compname,:time,:status,:ccr)");
>
-- snip --
First, always provide the column names in the SQL statement. They might not
actually be in the order you think they are. And, in general, it's safer.
For example:
INSERT INTO Foo (a, b, c) VALUES (:a, :b, :c)
Give that a try.
- Arnie
Technical Details
Message-ID:
<421f3380$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-mailReferences:
<421e146a$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,a417b8aa4c547b63 X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Arnie" <none> Newsgroups: borland.public.cppbuilder.database.ado References: <421e146a$1@newsgroups.borland.com> Subject: Re: ADO ParamByName I just don't get. Date: Fri, 25 Feb 2005 09:17:30 -0500 Lines: 46 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 24.151.53.204 Message-ID: <421f3380$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1109341056 24.151.53.204 (25 Feb 2005 06:17:36 -0800) 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