I have a question about an example...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I have the need to change a Datatable into an ADO Recordset. I have found the article "Much ADO About Data: Doing the Impossible (Again) by William Vaughn at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnhcvb03/html/vb03l10.asp. In the article the project writes and uses two XML files. Since I am going to be using this with an ASP.NET project I would think that writing temp files would be a bad idea. I was looking into using MemoryStream, but not really sure if I am going down the right path or what problems that would cause. Is there a way of changing a Datatable into an ADO Recordset without having the need to write any files to the hard drive based on this example? Or....does anyone have any other ideas on how to do this all within memory

TIA
 
Yes, I expect that you'll have to use memory streams to persist the XML
files. It's been awhile since I wrote that article and I'm focusing on newer
technology now-a-days.

Frankly, I would do my best to get rid of the ADO classic Recordset from the
design. You're only slowing down the conversion to .NET and more stable
functionality.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Charles said:
Hello,

I have the need to change a Datatable into an ADO Recordset. I have found
the article "Much ADO About Data: Doing the Impossible (Again) by William
Vaughn at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnhcvb03/html/vb03l10.asp.
In the article the project writes and uses two XML files. Since I am going
to be using this with an ASP.NET project I would think that writing temp
files would be a bad idea. I was looking into using MemoryStream, but not
really sure if I am going down the right path or what problems that would
cause. Is there a way of changing a Datatable into an ADO Recordset without
having the need to write any files to the hard drive based on this example?
Or....does anyone have any other ideas on how to do this all within memory?
 
Well, IIRC you have to pass a Recordset formatted as an XML string to the
Open method. Convert from your memory stream to a string first.
I would try to do the conversion in the middle tier--not real-time in the
ASP.NET application--but that's just me.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Charles said:
Thanks for the reply!

Changing much of the Strings to MemoryStreams I am having a problem with
"rsResult.Open(strResultXML)". I changed strResultXML to a MemoryStream.
Part of the problem that I am having is using the MemoryStream, just started
using it today. Am I still headed in the right direction?
It would be real nice if I could get rid of the ADO classic Recordsets.
However, this is not an option right now. I am working on a new (ASP.NET)
project that works with a VB6 application that has middle-tier objects. In
the beginning of 2005 (or even 2006) we may upgrade the VB6 application to
..NET.
 
Back
Top