View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ravi Ravi is offline
external usenet poster
 
Posts: 1
Default Function Sequence Error

Hi,
I have a VBA script that pulls data from Oracle Server and stores it in a
recordset. Here is part of the code:

Set RS = New ADODB.Recordset
Ssql1 = qryWeeklyEffRpt()
RS.Open Ssql1, oconn, adOpenKeyset

If RS.BOF = True And RS.EOF = True Then
GoTo 600
Exit Sub
Else
Do While RS.EOF = False
RS.MoveNext
m = m + 1
Loop
End If
RS.MoveFirst <========= (Function Sequence Error)

Sheet5.Cells(RowCounter, 2).CopyFromRecordset RS

Set RS = Nothing

This works fine at work on my laptop. But when I connect remotely using
VPN it errors out with the 'Function Sequence Error'. When debugged it
shows the error occurred at the statement shown above. This occurs whether
the recordset has one or more rows. Any help would be appreciated.

Thanks - Ravi