Hello,

I've programmed a server which uses a database to get and store information about the users. The server supports multiple connections and data is saved alot.

Because of the CPU use of the server with every huge action a user does, I'm thinking about changing the updating and retreiving to and from the database (MS Access) to using variables, and saveing the data to the database in a interval of 15 minutes. The loss of data in a server crash is acceptable, crashes are not common (anymore ).

Now, I have a function called SQL(strQuery) as RecordSet which I call to get the database information. Updating is done local:
VB Code:
  1. Dim RS as RecordSet
  2.  
  3. Set RS = SQL("SELECT * FROM Users")
  4. RS!UserName = "Guest"

Now I was wondering when I create a variable like
VB Code:
  1. Dim Users as RecordSet
And I copy the whole Users table from the database into this variable, how I can select a few records from the variable as a new recordset.

So my SQL function could do a routine on the variable 'Users' and the rows left over after a selection routine could be returned as the SQL() so I don't have to update all the code elsewhere in the server.

However, this setting of the SQL() must be done ByRef because, when someone would so Set RS as SQL("SELECT * FROM Users") and change the RS, the corresponding field in the Users variable (used by the SQL() function) should also change to the new value.

Is this possible, if please can someone show me how?

Thank you for your time...