🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Setting Query Parameters to a NULL string

#822
From: Ondrej Gratz
Date: Wed, 25 May 2005 15:11
30 lines
1863 bytes
Enclose string parameters in quotation marks...

INSERT INTO myTable (MyField, field2) VALUES (":MyField", ":field2")

Sincerely
Ondrej Gratz

Stephen Craig wrote:
> Hi
> I'm "playing" with an Access DB and am having problems setting query
> Parameters to a String when the string is a empty.
> 
> eg
> for the query
>       INSERT INTO myTable (MyField, field2) VALUES (:MyField, :field2)
> 
> If I set the parameter ...
>     qry->Parameters->ParamByName("MyField")->Value = "";
> I get this error when I ExecSQL() "...Invalid Precision Value"
> 
> If I set the field without using parameters then all is Ok ie ...
>     INSERT INTO myTable (MyField, field2) VALUES ("", "some text")
> 
> Can I use Parameters when the fields may be Null strings?
> 
> Thanks
> Steve
> 
> 
> 
Technical Details
Message-ID: <4294958b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <428c1ce6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,5acac13d62ebf4f7
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 25 May 2005 17:11:05 +0200
From: Ondrej Gratz <gratzo@atlas.cz>
User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: Setting Query Parameters to a NULL string
References: <428c1ce6$1@newsgroups.borland.com>
In-Reply-To: <428c1ce6$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 7bit
X-Antivirus: avast! (VPS 0521-2, 25.05.2005), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 85.160.73.218
Message-ID: <4294958b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1117033867 85.160.73.218 (25 May 2005 08:11:07 -0700)
Lines: 30
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail