I try to create a recordset in memory using below code.
The problem is I can not create a unique index to prevent duplicate
Primary Key for "Field1"+"Field2".
Any ideas is welcome.
----------------------------------------------------------------------
Set rs = New ADODB.Recordset
With rs.Fields
.Append "Field1", adVarChar, 255
.Append "Field2", adVarChar, 255
.Append "Field3", adVarChar, 255
End With
rs.Open
-----------------------------------------------------------------------
HELP!
Thanks
Jeerakarn W.
> I try to create a recordset in memory using below code.
> The problem is I can not create a unique index to prevent
duplicate
> Primary Key for "Field1"+"Field2".
You could guarantee "Field1"+"Field2" to be unique if they were GUIDs. Each
guid would have to be varchar (40) and the concatenated GUID would be
varchar (80). Be sure to test for performance.
Set rs = New ADODB.Recordset
With rs.Fields
.Append "Field1", adVarChar, 255
.Append "Field2", adVarChar, 255
.Append "Field3", adVarChar, 255
End With
rs.Open
But I can not using a VB code to create a unique index for this memory
recordset. Actually I can use a vb code
to check a duplicate primary key before I add some record. It will be
better and easier for my life if I can use a
MS ADO DATA Control with an Datagrid Control to input data without worry
about duplicating PK. I try to use
ADOX but it does not support at all. Again try to find some VB Code to
do this.
Help please,
Jeerakarn W.
"George Copeland" <tma...@DELETETHISmail.com> wrote in message
news:vcdgc.8591$bw4....@newssvr24.news.prodigy.com...