I am not understanding the significance of adFldKeyColumn. I thought this might make a field as in MS Access the key or primary field so that the value could only be in the recordset once. But in the following code, the string "ab" is inserted twice. Any help in clearing up what I am doing wrong or not understanding would be appreciated.
Dim arValues(5) As String
Dim rst As Recordset
Dim s As String
Dim v As Integer
arValues(0) = "ab"
arValues(1) = "bcd"
arValues(2) = "cdef"
arValues(3) = "zzz"
arValues(4) = "ab"
Set rst = New Recordset
rst.Fields.append "itemKey", adVarChar, 15, adFldKeyColumn
rst.open
For v = 0 To 4
rst.AddNew
rst.Fields("itemKey"
= arValues(v)
rst.Update
Next
s = ""
rst.MoveFirst
Do Until rst.EOF
s = s & rst("itemKey"
& vbCrLf
rst.MoveNext
Loop
MsgBox s
rst.close
TIA
Parke
Dim arValues(5) As String
Dim rst As Recordset
Dim s As String
Dim v As Integer
arValues(0) = "ab"
arValues(1) = "bcd"
arValues(2) = "cdef"
arValues(3) = "zzz"
arValues(4) = "ab"
Set rst = New Recordset
rst.Fields.append "itemKey", adVarChar, 15, adFldKeyColumn
rst.open
For v = 0 To 4
rst.AddNew
rst.Fields("itemKey"
rst.Update
Next
s = ""
rst.MoveFirst
Do Until rst.EOF
s = s & rst("itemKey"
rst.MoveNext
Loop
MsgBox s
rst.close
TIA
Parke