How to fill a RecordSet without a connection
Hi,
Yes, you can create fabricated recordset using next kind of code
Dim MyRecordset As ADODB.Recordset
Set MyRecordset = New ADODB.Recordset
With MyRecordset.Fields
Set MyRecordset.ActiveConnection = Nothing
MyRecordset.CursorLocation = adUseClient
.Append "COLUMN_1", adInteger
.Append "COLUMN_2", adVarChar, 10, adFldIsNullable
MyRecordset.Open
End With
Now you can add records to it using AddNew method
MyRecordset.AddNew
MyRecordset.Fields("COLUMN_1").Value=1
MyRecordset.Fields("COLUMN_2").Value="Test"
MyRecordset.Update
--
Val Mazur
Microsoft MVP
Quote:
> Hi All,
> Is it possible to populate a record set with some value
> without making a connection to the DB. Like, I create a
> recordset and create my own fields col1,col2 etc which do
> not belongs to any table, and then populate those fields
> with values comming from strings / arrays etc.
> Thanks in advance
> Sanjib