Seek using an index with multiple Replication ID fields

  • Thread starter Thread starter Michael S. Meyers-Jouan
  • Start date Start date
M

Michael S. Meyers-Jouan

I'm developing an application that implements a many-to-
many relationship among several tables. Each base table
has an Auto-Number field as the Primary Key, and that
field is of type "Replication ID".

I want to do a check in the many-to-many table for a
match to a particular relationship, which is represented
by copies of the ID fields from the base tables. I'm
creating a table-type RecordSet and selecting a pre-
defined, multi-field index that includes more than one ID
field. When I try to execute a Seek on the RecordSet, I
get a "data type conversion error".

Does anybody have any experience using indexes that
include multiple fields of type "Replication ID"? Any
suggestions on how to get code like the following to work?

Set rstValid = CurrentDb.OpenRecordset
("tRelationships", dbOpenTable)
rstValid.Index = "MatchIndex"
rstValid.Seek "=", rstEntity1!
, Me!
[txtFromID], rstRelation![ID], rstEntity2!
, Me!
[txtToID]
bValid = rstValid.EOF
 
Does anybody have any experience using indexes that
include multiple fields of type "Replication ID"? Any


Only enough experience to avoid it. Your problem is
probably that the ID has been converted to a String,
and now doesn't match the ID anymore. Something you
can try: take a look at the string, then modify it by
adding/removing bits of the string like "GUID" and
"{" to see if the string works if you use a different
format for the Replication ID.

(david)



Michael S. Meyers-Jouan said:
I'm developing an application that implements a many-to-
many relationship among several tables. Each base table
has an Auto-Number field as the Primary Key, and that
field is of type "Replication ID".

I want to do a check in the many-to-many table for a
match to a particular relationship, which is represented
by copies of the ID fields from the base tables. I'm
creating a table-type RecordSet and selecting a pre-
defined, multi-field index that includes more than one ID
field. When I try to execute a Seek on the RecordSet, I
get a "data type conversion error".

Does anybody have any experience using indexes that
include multiple fields of type "Replication ID"? Any
suggestions on how to get code like the following to work?

Set rstValid = CurrentDb.OpenRecordset
("tRelationships", dbOpenTable)
rstValid.Index = "MatchIndex"
rstValid.Seek "=", rstEntity1!
, Me!
[txtFromID], rstRelation![ID], rstEntity2!
, Me!
[txtToID]
bValid = rstValid.EOF
 
Back
Top