[AccessD] ADO Save recordset format adPersistADTG

Jim Lawrence accessd at shaw.ca
Wed Jun 14 15:16:15 CDT 2006


Hi Martin:

This is not the exact code that matches your requirements but it shows you
how to move through a recordset(s).

<code>
With rststudent
 If .BOF = False Or .EOF = False Then
   .MoveLast  'initialize recordset rststudent
   .MoveFirst
   Do While .EOF = False
     
     ...do the work here 
	'Ie Move through all fields of current record
      ' For i = 0 To .Fields.Count - 1
      '  Message "Field " & str(i) & " = " & .Fields(i).Value
      ' Next
     ...
		
     .MoveNext
    Loop
   Else
     MsgBox "No Student Data"
   End If
 End With
</code>

HTH
Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin Reid
Sent: Wednesday, June 14, 2006 11:41 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] ADO Save recordset format adPersistADTG

The for next is the first time I have tried it this way.Something basic is
not there. I know it. Just cant think.

 

Private Sub Form_Open(Cancel As Integer)

On Error GoTo Err_Form_Open

Dim rststudent As ADODB.Recordset

Dim conn As ADODB.Connection

Dim fld As ADODB.Field

Set conn = CurrentProject.AccessConnection

Set rststudent = New ADODB.Recordset

rststudent.ActiveConnection = conn

rststudent.Open "usp_GetStudentData", , , , adCmdStoredProc

If rststudent.EOF = True Then

MsgBox "No Student Data"

Exit Sub

Else

 

For Each fld In rststudent.Fields

                        Me(fld.Name).Value = fld.Value

Next

End If

 

Exit_Form_Open:

Exit Sub

Err_Form_Open:

        MsgBox Err.Description, , "Error in Sub
Form_frmChapter6SPExample.Form_Open"

        Resume Exit_Form_Open

    Resume 0   

End Sub

 
Martin WP Reid
Training and Assessment Unit
Riddle Hall
Belfast
 
tel: 02890 974477
 

________________________________

From: accessd-bounces at databaseadvisors.com on behalf of Heenan, Lambert
Sent: Wed 14/06/2006 19:33
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] ADO Save recordset format adPersistADTG



This reference  gives an example of what it's for. The idea is you can
create an application that uses database methods, without there actually
being a database!

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dninvb00/ht
ml/ADORecordset.asp


Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Wednesday, June 14, 2006 2:13 PM
To: accessd at databaseadvisors.com
Subject: [AccessD] ADO Save recordset format adPersistADTG


Hi all

With ADO you can save a recordset to a file, normally an XML file, but
another format, Microsoft Advanced Data TableGram, exists:

  rst.Save "d:\temp\records.dat", adPersistADTG

Where or why could this binary format be used?
It creates file sizes about 1/3 of the XML file created if adPersistXML had
been used. Is it just a proprietary format for storing and retrieval of data
to/from a single external file?

/gustav

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com/> 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com <http://www.databaseadvisors.com/> 






More information about the AccessD mailing list