Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Compound index of integer ??
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 2nd June 11:37
nxpavesi
External User
 
Posts: 1
Default Compound index of integer ??



How can i define a compund index of 3 integer (Fox compatibility) and
make seek on it?

I'm using c# version on wincce.

Thanks.
  Reply With Quote


  sponsored links


2 2nd June 11:38
gregatacd
External User
 
Posts: 1
Default Compound index of integer ??



What I did for this is create a couple of definitions as follows
(these are c++ examples using mfc's CString, but you should be able to
work out a similar c# methodology).

// define tag and usage formats... filled with zeros. Spaces could
also be used...
#define COMP_ID_3_FORMAT "%010d%010d%010d"
#define COMP_ID_3_TAG_FORMAT
"STRZERO(%s,10)+STRZERO(%s,10)+STRZERO(%s,10)"

Then when I create my tag, I do:

Tag4info t4iTags(myCB4);
CString strTag;
strTag.Format(COMP_ID_3_TAG_FORMAT, "FIELD1", "FIELD2", "FIELD3");
t4iTags.add("MYTAGNAME, strTag, NULL, 0, 0);
// use t41tags when creating your index

When doing a search, I do the following:

CString szSearch; szSearch.Empty();
szSearch.Format(COMP_ID_3_FORMAT, nField1, nField2, nField3);
int rc = myTable.seek(szSearch);

Hope this helps...

Greg
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666