Hi Robert, Thanks for your reply. I tried your comments with no success, but used your leads and came up with the "RecSetName.CursorType = adOpenKeyset" addition to the code. Still No Joy. The only difference between the examples I've seen and my code is that I move the recordset created from the Database into another recordset for VB manipulation. Below are the debug messages I get when running the code. My code follows the messages
?RecSetName.Supports (adAddNew
Fals
?erro
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype
Thanks again...Ro
Private Sub Form_Load(
Dim RecSetName As ADODB.Recordse
Set RecSetName = New ADODB.Recordse
RecSetName.LockType = adLockBatchOptimisti
RecSetName.CursorLocation = adUseClien
RecSetName.CursorType = adOpenKeyse
sSql = "SELECT DISTINCTROW ExpDate, Field1, Field2, ' ' AS StatDescr FROM Table1
If GetData(RecSetName, sSql, "") The
Do Until RecSetName.EO
If U.DBLng(RecSetName!ExpDate) < nAdvMemExpDate
Then RecSetName!StatDescr = " [EXPIRED]"
Else RecSetName!StatDescr = " [Active]
'Error occurs on the above IF statemen
..
End Su
Public Function GetData(rsO As Object,
sSql As String,
sParam As String,
Optional nRows As Long = 0) As Boolea
On Error GoTo ErrorTa
Dim rs As ADODB.Recordse
Dim nRetryCt As Intege
nRetryCt =
GetData = Fals
nRows =
Set rs = New ADODB.Recordse
sSql = sSql & sPara
ReTryTag
If ConnectDB() The
TheDB.Execute sSq
rs.CursorLocation = adUseClien
rs.Open sSql, TheDB, adOpenForwardOnly, adLockReadOnly, adCmdTex
Set rs.ActiveConnection = Nothin
If Not rs.EOF The
rs.MoveLas
rs.MoveFirs
GetData = (rs.RecordCount > 0
nRows = rs.RecordCoun
End I
Set rsO = r
End I
ExitTag
Set rs = Nothin
Exit Functio
ErrorTag
..
End Functio