🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Setting Query Parameters to a NULL string

#815
From: Stephen Craig
Date: Thu, 19 May 2005 04:58
19 lines
1457 bytes
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: <428c1ce6$1@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

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,5acac13d62ebf4f7,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Stephen Craig" <stevecraig@ozemail.com.au>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Setting Query Parameters to a NULL string
Date: Thu, 19 May 2005 14:58:18 +1000
Lines: 22
Organization: Cubic Software
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 203.103.115.35
Message-ID: <428c1ce6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116478694 203.103.115.35 (18 May 2005 21:58:14 -0700)
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