Thread View: borland.public.delphi.database.win32
2 messages
2 total messages
Started by Frank Burleigh
Sat, 31 May 2008 05:11
Using TDataset.Locate with one value
Author: Frank Burleigh
Date: Sat, 31 May 2008 05:11
Date: Sat, 31 May 2008 05:11
23 lines
1559 bytes
1559 bytes
My real problem is that I don't know how to work with variant arrays: v:variant; Always fails with "Error creating variant or safe array," v:=VarArrayCreate( [0,1], varString ); but this is ok: v:=VarArrayCreate( [0,1], varVariant ); So then I do: V[0]:=mystring; mydataset.Locate( 'Lastname', V, [] ); only to get "could not convert variant of type (array variant) into type (string)." The help text (in RAD 2007 Arch) is unhelpful; following it produces about the same troubles. It's example text is too specific and doesn't show a variety of scenarios. I'd appreciate a nudge back on track. Thank you!
Re: Using TDataset.Locate with one value
Author: Mike Shkolnik
Date: Sat, 31 May 2008 09:42
Date: Sat, 31 May 2008 09:42
35 lines
1945 bytes
1945 bytes
Use the next code for Locate: mydataset.Locate( 'Lastname', mystring, [] ); -- With best regards, Mike Shkolnik Scalabium Software http://www.scalabium.com mshkolnik@scalabium.com "Frank Burleigh" <burleigh@indiana.edu> wrote in message news:4840ddff@newsgroups.borland.com... > My real problem is that I don't know how to work with variant arrays: > > v:variant; > > Always fails with "Error creating variant or safe array," > v:=VarArrayCreate( [0,1], varString ); > > but this is ok: > v:=VarArrayCreate( [0,1], varVariant ); > > So then I do: > > V[0]:=mystring; > mydataset.Locate( 'Lastname', V, [] ); > > only to get "could not convert variant of type (array variant) into type > (string)." > > The help text (in RAD 2007 Arch) is unhelpful; following it produces > about the same troubles. It's example text is too specific and doesn't > show a variety of scenarios. > > I'd appreciate a nudge back on track. Thank you! >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads