re-writing a memory array to the database

G

Guest

I have an application that reads many thousands of record from "Dataset 1".
One of the processing steps requires me to read "X" records into a memory
array from Dataset 1. When a certain value changes, I must then process the
memory array, setting and/or clearing certain field values. If any one record
in the array gets changed, it requires I update all records in that
"mini-batch". Now the kicker - Since the recset has already moved to a
subsequent series of records, I thought I could just re-issue an OPEN/SELECT
on the same dataset by primary key, then post the update from the array.

However, this generates an error message:

The connection cannot be used to perform this operation. It is either closed
or invalid in this context

I have the dataset opens the same for all my reads. That is:

Set recSet2 = New ADODB.Recordset
recSet2.CursorLocation = adUseServer
recSet2.CursorType = adOpenKeyset
recSet2.LockType = adLockOptimistic
recSet2.Open "SELECT * ....."

The open is where it barfs. Any assistance would be deeply appreciated.

tHANKS!
 
B

Brendan Reynolds

You don't appear to have assigned anything to the ActiveConnection property
of the recordset, or passed a connection as the second argument of the Open
method. You need to do one of the two.
 
G

Guest

That was it! My "paste" of existing code missed that line, and I didn't catch
it. Problem solved, and THANK YOU!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top