DB-less Data Shaping?

Results 1 to 2 of 2

Thread: DB-less Data Shaping?

  1. #1
    DVA13 Guest

    Default DB-less Data Shaping?

    I see how SHAPE is used to retrieve hierarchical data in a single recordset, but now I&#039m wondering about the possibility of creating it.<BR><BR>The situation is that I&#039m building a few recordsets dynamically (using Recordset.CursorLocation = adUseClient, and Recordset.Fields.Append) without being connected to any database.<BR><BR>What I&#039d like to be able to do is to merge the multiple related recordsets into a single hierarchical recordset, to make the data easier/more efficient to work with.<BR><BR>Any thoughts?

  2. #2
    Eric Kinateder Guest

    Default RE: DB-less Data Shaping?

    You can create chaptered or shaped recordsets that don&#039t have a connection to a database by specifying the Data Provider as &#039none&#039 in the connection string. <BR><BR> Dim strConnectionString<BR> strConnectionString = "Provider=MSDataShape; " & _<BR> "Data Provider=None"<BR> <BR> Dim strCommandText<BR> strCommandText = "SHAPE APPEND " & _<BR> " NEW adVarChar(9) AS SSN, " & _<BR> " NEW adVarChar(50) AS Name, " & _<BR> " ((SHAPE APPEND " & _<BR> " NEW adVarChar(50) AS TicketID, " & _<BR> " NEW adVarChar(9) AS SSN, " & _<BR> " NEW adInteger AS MPHOverLimit, " & _<BR> " NEW adCurrency AS PenaltyAmount) " & _<BR> " RELATE SSN TO SSN) AS SpeedingTickets "<BR> <BR> <BR> Dim rstPerpetrators As ADODB.Recordset<BR> Set rstPerpetrators = New ADODB.Recordset<BR> <BR> rstPerpetrators.Open strCommandText, strConnectionString, _<BR> adOpenStatic, adLockBatchOptimistic<BR> <BR> &#039add the perpetrator<BR> rstPerpetrators.AddNew<BR> rstPerpetrators("SSN") = "123456789"<BR> rstPerpetrators("Name") = "John Smith"<BR> rstPerpetrators.Update<BR> <BR> &#039add some speeding tickets<BR> Dim rstSpeedingTickets As ADODB.Recordset<BR> Set rstSpeedingTickets = _<BR> rstPerpetrators("SpeedingTickets").Value<BR> <BR> rstSpeedingTickets.AddNew<BR> rstSpeedingTickets("TicketID") = "XXX-123"<BR> rstSpeedingTickets("MPHOverLimit") = 15<BR> rstSpeedingTickets("PenaltyAmount") = 255.95<BR> rstSpeedingTickets.Update<BR> <BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts