Converting .NET DataTable to ADO Recordset

  • Thread starter Thread starter Nick Finch
  • Start date Start date
N

Nick Finch

Can anyone help. We have an Application that includes a
number of VBA addins. As a result, to be compatible with
old versions of Office Apps, we must convert any data from
a VB.NET DataTable to a disconnected ADO Recordset.

I have spent a bit of time looking at this, but can only
see references to using the DataAdaptor Update method,
which only seems to apply if the data originated from the
ADO Recordset. Does anyone know an efficient method of
converting a VB.NET DataTable to a disconnected ADODB
Recordset.

Thanks in advance
Nick
 
Hi Nick,

AFAIK there is only support for recordset->datatable direction and not the
inverse.
You should code it yourself.
 
¤ Can anyone help. We have an Application that includes a
¤ number of VBA addins. As a result, to be compatible with
¤ old versions of Office Apps, we must convert any data from
¤ a VB.NET DataTable to a disconnected ADO Recordset.
¤
¤ I have spent a bit of time looking at this, but can only
¤ see references to using the DataAdaptor Update method,
¤ which only seems to apply if the data originated from the
¤ ADO Recordset. Does anyone know an efficient method of
¤ converting a VB.NET DataTable to a disconnected ADODB
¤ Recordset.

Efficient or direct method, no, but it's possible if you don't mind writing a bit of code:

http://www.google.com/groups?hl=en&[email protected]&rnum=7


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
If you check out this month's Hard Core Visual Basic Newsletter,
www.hardcorevisualbasic.com Bill Vaughn has an article where he is "Doing
the Impossible (Again). He goes through using ADO.NET to create a classic
Recordset. I think you can get a free 30 day trial which will give you
access to it (although you probably would want to describe b/c there's some
really great stuff in there.)

HTH,

Bill
 
Back
Top