Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

in memory recordset 1

Status
Not open for further replies.

jurgen

Programmer
Feb 8, 2001
209
BE
Can someone give me an example on how i can build a ADO recordset in memory based on a data in a database.

I'm trying to read the data into a ADO recordset, put it in memory, disconnect with the database and then using the data in memory through my application without having to go each time to the database, because the data is read-only

Thnx

Jurgen
 
Hi jurgen,

Placed in a module
Code:
Public rst As ADODB.Recordset
Executed anywhere in your application
Code:
Set rst = New ADODB.Recordset
With rst
   .ActiveConnection = CurrentProject.Connection
   .CursorLocation = adUseClient
   .CursorType = adOpenStatic
   .LockType = adLockReadOnly
   .Source = "SELECT Customers.* From Customers;" 
   .Open 'Here the recordset is opened
   .ActiveConnection = Nothing ' Here is disconnected from DB
End With

But adLockReadOnly doesn't allow changes either you disconnect it or not .......

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top