INETA

 

Passing Recordsets Between Tiers
(Taken from VBITS 2000 - Slide presentation given by William R. Vaughn ) 

Passing Recordsets Between Tiers

Consider Memory expenses 
Cache on server, client 
Cursor location 
Consider LAN expenses 
Unicode or ANSI 
Padded structures or raw binary 
Consider client’s intelligence 
Ability to process 2.5 structures? 
Code to bind, update, decipher, display structure 
ADO capable?
Limit size of rowset, locks, overhead

Recordset Services

Manages rowset/result set
not parameters 
Manages secondary result set(s) 
Cursor services 
Scrolling 
Binding 
Updatability
Source/Persistence from/to files, streams, Recordsets, data providers 
Support by controls (Recordset property) 
Full data description language (DDL)

Passing Disjoint Recordsets

Use Client(batch) CursorLocation 
Open Recordset as usual 
Assign (don’t Set)
ActiveConnection = Nothing 
Can be updatable, or RO 
Use RecordCount for row count
(when available) 
Includes record status

Passing Recordsets…

Client-side code: 
Dim rsLocal as ADODB.Recordset 
Set rsLocal = GetRecs(txtFilter) 
If rsLocal.EOF Then 
   
   
Else 
    ' You now have the Rows in rsLocal
    Set MSHFlexGrid1.Recordset = rsLocal
End If

Passing Recordsets…

Server-side code
 Public Function GetRecs(Author As String) As Recordset 
    Dim rs As Recordset 
    OpenConnection 
    Set rs = New Recordset 
    With rs 
       
       
        "WHERE author LIKE '"& Author  & "' ", cn, _
       
        ' You don't have to use SET here, just use = alone
        .ActiveConnection = Nothing 
    End With 
    cn.Close 
    Set GetRecs = rs 
End Function
 

 

Send mail to vblg@xocomp.net with questions or comments about this web site.
Copyright © 1998-2003 XOCOMP, llc
Last modified: 04/05/2002