Problems with compound key with string fields 
Author Message
 Problems with compound key with string fields

Hello together,

I noticed problems when retrieving data from a table having a compound
primary key.
The table has three string fields (echa 10 character long), among others
, which define the compound primary key (the names are refId, refWpId,

Now when I specify the m_strFilter member variable of the CRecordset
class with

m_strFilter = "refId = 'ref1' AND refWpId = 'wp1' AND refPtId = 'p1'"

then the Open() command does not find any data (the record with this key
exists in the database).

The strange thing is, that when I specify a wildcard in the third
parameter, i.e. '%' instead of 'p1', then the Open() command finds the

Has anybody else encountered problems with tables having three string
fields as a compound primary key. The strange thing about this is, that
I have several other tables having two string fields and one numerical
fields as a compound primary field and these tables work fine.

Are there any known problems with string fields in a compound primary
key ?

I'm using VC++4.2b under Win95.

thanks for any help


Sat, 26 Jun 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. You have a problem with an AutoNumber,Inkrement,Primary key field

2. string table resource string field definitions

3. Problem using string as key in map

4. Problem with tabControl in my compound control

5. Problem with compound files

6. Problem saving compound document

7. BTrieve, How to create Key from 2 fields ?

8. DAO/Indexes/Empty Key fields

9. How to create multiple fields for index key

10. Getting key field value after insert

11. Troubles when i try to get the automatically inserted key field with ADO

12. Using the Return key to change input fields (CEdit)


Powered by phpBB® Forum Software