Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a in memory table that gets created, and want to join it to a table from SDE. I have tried the following code.

Private Sub JoinTables(sdetable As ITable, inMemoryTable As ITable, joinField As String)

++ Create the MemoryRelationshipClass that defines what is to be joined   
Dim pMemRelClassFact As IMemoryRelationshipClassFactory   
Set pMemRelClassFact = New MemoryRelationshipClassFactory   
Dim pRelClass As IRelationshipClass   
Set pRelClass = pMemRelClassFact.Open("test", sdetable, "ID_NUMBER", inMemoryTable, "ID_NUMBER", "forward", "backward", esriRelCardinalityOneToMany)   
' ++ Perform the join   
Dim pRelQueryTableFact As IRelQueryTableFactory   
Dim pRelQueryTab As ITable   
Set pRelQueryTableFact = New RelQueryTableFactory   
Set pRelQueryTab = pRelQueryTableFact.Open(pRelClass, True, Nothing, Nothing, "", True, True)

  ' ++ Print the fields   Dim pCursor As ICursor   Set pCursor = pRelQueryTab.Search(Nothing, True)
     Dim pField As IField   
Dim pFields As IFields   
Dim intI As Integer, intJ As Integer
Set pFields = pCursor.Fields   
intI = pFields.FieldCount - 1   
For intJ = 0 To intI
Set pField = pFields.Field(intJ)
    Debug.Print pField.Name   Next intJ 
End Sub

but i get a type mismatch error on the line

  Set pRelClass = pMemRelClassFact.Open("test", sdetable, "ID_NUMBER", inMemoryTable, "ID_NUMBER", "forward", "backward", esriRelCardinalityOneToMany)

Is it not possible to join a in memory table to an sde table, or is there a better way of doing this?

Thanks

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.