It is good pratice on Web Sites to use Dis-connected RecordSets. This is because on high traffic sites the number of connections permitted can be exceeded very quickly. In addition resources are taken up with each connection. In this Example you have a DIS-CONNECTED RecordSet. You can then Add, Update, Delete or do whatever you please because the RecordSet is not Closed, it just does not have a connection. When you want to update the Database you merely restore the connection. Enough waffle here is how you do it.
Dim RS, SQL, MyDSN MyDSN = "Provider=SQLOLEDB; Data Source=[]local; Initial Catalog=DB; User Id=sa;" SQL = "SELECT * FROM SomeTable" Set RS = Server.CreateObject("ADODB.RecordSet") With GetRS .CursorLocation = adUseClient .CursorType = adOpenStatic .LockType = adLockOptimistic .Open SQL, MyDSN Set .ActiveConnection = Nothing End With ... ...Do your Stuff ... Set RS.ActiveConnection = MyDSN RS.Update Set RS = Nothing
PS. I always use Client Side Cursors because you can readily achieve the RecordCount.