Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: How to Open a peristed recordset of type stream


Message #1 by andrew.c.watts@b... on Mon, 2 Oct 2000 05:44:25 +0100
How do I read this recordset back - having persisted it as string ?
Is there really a connection object and if so how do I make it ??

Set GetADORecordsetFromTable = rstSQL
rstSQL.Save F, adPersistADTG ' regular binary format
Dim ObjRS As New ADODB.Recordset
Debug.print rstSQL.CursorLocation ' ( this is adUseClient - # 3 )

' now the recordset is disconnected, saved to a stream that I can
pass around
' but how do I read it back into an ADO recordset
' the open property asks for a connection object
' but if I use that what is the format to establish it ?
'


Dim streamCnx As New ADODB.Connection
Set streamCnx = Me.JetconnStream(F, errormes)
ObjRS.Open F, streamCnx, adOpenForwardOnly
'Set ObjRS = f ' ??? try

This did not seem to work either :

Function JetconnStream(F As Stream, errormes As String) As
ADODB.Connection
Dim ADOJetProvider As String
On Error GoTo errorTrap
Dim bdidError As Boolean
Set JetconnStream = New ADODB.Connection
With JetconnStream
.Provider = Me.thisJetProvider
.Properties("Jet OLEDB:Database Password") = Me.thisMDBPassword '
"xxxx"
.ConnectionString = F
.CursorLocation = adUseClient
.Open F
End With
Exit Function
errorTrap:
errormes = Err.Description
' OK so try nothing
' Jetconn.Properties("Jet OLEDB:Database Password") = ""
' Jetconn.Open strMDBpath
End Function

  Return to Index