Hi,
Normally when you show records from a database in a table
in .asp you create connectionstring, recordset and so on.
If the amount of data in the database is small ( < 20000
records) and easily will fit in RAM you could improve
performance dramatically by creating a recordset in RAM
and also do the sorting there as well.
An example:
Dim rstR
Set rstR = Server.CreateObject("ADODB.Recordset")
rstR.Fields.Append "myDate", adDate
rstR.Fields.Append "myAmount, adCurrency
rstR.Open
Now there is a recordset in RAM that can be used, although
empty still.
I also have a normal persistent table (initialised,
connected and named rstX) from where I fetch the records.
With rstX
.MoveFirst
Do While Not .Eof
rstR.AddNew
rstR.Fields("myDate") = .Fields("myDate")
rstR.Fields("myAmount") = .Fields("myAmount")
.MoveNext
Loop
End With
Now the rstR inline recordset in filled up with data.
Let's assume I want to let all sessions in a webapp share
the same inline table (rstR).
It's absolute critical that the rstR inline table should
ONLY be created ONCE on the webserver and that every
session can use it.
Should I use the application object to achive this?
Could someone give me some code and where to initialize
that code?
TIA
/Kenneth