jtseltmann
Programmer
I have created a simple disconnected recordset in one of my apps that just tracks record processed and some other data on the fly. I'm wondering if there is a way to assign a primary key value to the first field I appended in the recordset. I have searched and searched and cannot find any help.
My code is simply just:
Dim rs as ADODB.Recordset
Set rs = NEW ADODB.Recordset
With rs.Fields
.append "field1", adVarChar, 50
.append "field2", adVarChar, 50
End with
rs.CursorType = adUseClient
rs.LockType = adLockBatchOptimistic
rs.Open
then i add records on the fly. I want to have field1 be a key value to I know if dupes are added. Rather then checking each time I thought I could assign it a primary key. I can find nothing on this...
Anyone have any thougths for me?
Thanks.
My code is simply just:
Dim rs as ADODB.Recordset
Set rs = NEW ADODB.Recordset
With rs.Fields
.append "field1", adVarChar, 50
.append "field2", adVarChar, 50
End with
rs.CursorType = adUseClient
rs.LockType = adLockBatchOptimistic
rs.Open
then i add records on the fly. I want to have field1 be a key value to I know if dupes are added. Rather then checking each time I thought I could assign it a primary key. I can find nothing on this...
Anyone have any thougths for me?
Thanks.