• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13.  Recordset Objects > Recordsets Without a Database Connection

Recordsets Without a Database Connection

You can create ADO recordsets that exist without a connection to a database and are saved only to memory. The following example illustrates this option:

Sub RecordsetWithoutDatabaseConnection()
 Dim rec As Recordset
 
 Set rec = New ADODB.Recordset
 With rec
 		' Create two fields
 		.Fields.Append "Filmtitle", adVarChar, 255
 		.Fields.Append "Sum", adCurrency
 		.Open
 		.AddNew
 		!Filmtitle = "Gladiator"
 		!Sum = 10000
 		.Update
 		.AddNew
 		!Filmtitle = "Terminator"
 		!Sum= 20000
 		.Update
 
 		.Sort = "Sum DESC"
   .MoveFirst
 
		Do While Not .EOF
 		  Debug.Print !Filmtitle, !Sum
 		  .MoveNext
 		Loop
 End With
End Sub


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint