Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Record Object 2

Status
Not open for further replies.

jmarler

Programmer
Jan 29, 2001
679
US
This may be a stupid qeustion, but I'll ask it anyway since it does not seem to be working for me. If I have a disconnected recordset in ADO, should I not be able to set an ADO record object = to a specific record? And if so, how is it done? Thanks!
- Jeff Marler B-)
 
Didn't get what you mean. How do you disconnected ADO recordset? Is it like:
rs.Close
If yes, then you will be able to use it again without set it first.

If it is like:
Set rs = Nothing
Then to use it again, you have to do this first:
Set rs = New ADODB.Recordset
 
OK, I did not explain that very well. I have a disconnected recordset and I would like to set the record object (NOT the recordset object) to a specific record in the recordset. Somtehing like this . . .


dim objRecordset as ADODB.Recordset
dim objRecord as ADODB.Record


{Assume for a moment that the disconnected recordset object (objRecordset) has been properly instantiated AND it is open AND it has valid data}

set objRecord = new ADODB.Record
objRecord.Open objRecordset


That is what I would like to do (get the data for 1 record in the recordset stored in a record object) and the ADO specs that I have say that you can use an open recordset object as the source for the open command on the record object, but everytime I try this, I get an error stating that the object or provider does not support this functionality. - Jeff Marler B-)
 
The record object is not exactly what it sounds like... (Been there myself... :)
What you would expect is that a record object is nothing more than an instance of the records that makes up the recordset object. This is not so.

The recordset object is designed to retrive data from an OLE-DB, the record object however is designed to retrive data from Document Source Providers. (OLE-DB provider for Internet Publishing supports it, and maybe some more.)
Document Source Providers are providers that allow access to data that are file based rather than data bases, like file systems and such.

The record object together with the stream object will give you the capacity to access the filesystem, including create, edit, delete, browse, move or just about anything filerelated the user has access to.

If you take it one step further, ASP supports the stream object via both the response and request object, witch means that you now have the tools to access the server fully (no execute though, thank goodness) on Internet via ADO.

All I want to see now is a simple to use tunneling object to sequre the data stream transfer. :)

-Mats Hulten
 
Thanks Mats . . . not quite the answer I wanted to hear (%-( Grrr), but I was starting to realize that myself. I was hoping to be able to pass single records around as a record (made sense to me) . . . for now, I just resorted to applying a filter to the recordset and persisting the recordset to XML via the stream object . . . that seems to work . . . - Jeff Marler B-)
 
Well you could always persist the recordset object into the record object via the stream object, but I'm not sure what good it will do you...

For my part I had some trouble understanding why I couldn't use
Code:
For Each oRecord In oRecordset...

Well, I guess we all make our mistakes... :)

-M
 
I don't HAVE to use a record object for what I am doing . . . but like you, I was thinkg that I would just say for each oRecord in oRecordset! Made perfect sense in my world . . . Oh Well . . . - Jeff Marler B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top