Robert S
August 28th, 2001, 02:28 PM
I've built a ActiveX exe Data Access Layer which uses ADO to connect to an Access Database. The client PC's use the object's GetRecordSet() method to gain access to the data. These recordsets are used by Crystal Reports to produce the applications reports. Here's the problem, The Server PC (ActiveX exe) runs out of memory while its looping through the recordset and updating it. It happens when a client PC request a large recordset. The ActiveX exe uses Client Cursor Service because I need to process through the recordset and call a function to decrypt the Encypted CardNumber, updating the recordset but not the database. This is done prior to sending it over the network to the client.
Here's how I set the recordset properties and open the recordset.
Dim cnn As Connection
Dim rsConnected As Recordset
Dim sSQl As String
Set cnn = New Connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sDatabasePath & ";Persist Security Info=False"
Set rsConnected = New Recordset
sSQl = "SELECT * FROM Transactions"
rsConnected.CursorLocation = adUseClient
rsConnected.Open sSQl, cnn, adOpenDynamic, adLockOptimistic
'Disconnect Recordset from database
rsConnected.ActiveConnection = Nothing
'Process through recordset, decrypt credit card column
If Not (rsConnected.BOF = True And rsConnected.EOF = True) Then
rsConnected.MoveFirst
Do While rsConnected.EOF = False
rsConnected.Fields("EncCardNumber").value = DecyrptData(rsConnected.Fields("EncCardNumber").value)
rsConnected.Update
rsConnected.MoveNext
Loop
End If
Thanks for any help you can offer.
Here's how I set the recordset properties and open the recordset.
Dim cnn As Connection
Dim rsConnected As Recordset
Dim sSQl As String
Set cnn = New Connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sDatabasePath & ";Persist Security Info=False"
Set rsConnected = New Recordset
sSQl = "SELECT * FROM Transactions"
rsConnected.CursorLocation = adUseClient
rsConnected.Open sSQl, cnn, adOpenDynamic, adLockOptimistic
'Disconnect Recordset from database
rsConnected.ActiveConnection = Nothing
'Process through recordset, decrypt credit card column
If Not (rsConnected.BOF = True And rsConnected.EOF = True) Then
rsConnected.MoveFirst
Do While rsConnected.EOF = False
rsConnected.Fields("EncCardNumber").value = DecyrptData(rsConnected.Fields("EncCardNumber").value)
rsConnected.Update
rsConnected.MoveNext
Loop
End If
Thanks for any help you can offer.