🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Locate and VarArrayCreate

#3219
From: Kim Utley
Date: Fri, 25 Oct 2002 18:26
20 lines
1530 bytes
Hello,

I'm getting an exception "Could not convert variant of type (Array Variant)
in type (String)" when the Locate() function is called. In my application I
need to dynamically create the field name(s) and key value(s) although in my
example I'm hard coding the data for testing. Most of the time they will be
strings but other data types will need to be used.

Any help would be appreciated.

TIA,

Kim

 int   bounds[2] = { 0, 1 };
 Variant  keyVal = VarArrayCreate( bounds, 1, varVariant);

 keyVal.PutElement( "01-01-0002", 0 );

 bool success = adoTable->Locate( "AccountNumber", keyVal, opts );
Technical Details
Message-ID: <3db98cbe@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,880f9a9f70573d4a,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2002-10-25 13:20:04 PST
From: "Kim Utley" <kim@simsware.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Locate and VarArrayCreate
Date: Fri, 25 Oct 2002 13:26:07 -0500
Lines: 22
Organization: SIMS, Inc.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 65.205.74.136
Message-ID: <3db98cbe@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1035570366 65.205.74.136 (25 Oct 2002 11:26:06 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail