Extract Data fromLotus notes

S

stew

Hi

I am using an ADODB Recordset to open a Lotus Notes dataset, executing
the following SQL string:

stSQL = "SELECT OptionMR.ClientName, OptionMR.ClientID,
OptionMR.Status FROM OptionMR OptionMR WHERE
(OptionMR.ClientID='6911')"

and can sucessfully return data, using the following loops:

While rst.EOF = False

For icols = 0 To rst.Fields.Count - 1
ActiveCell.Value = rst.Fields(icols).Value
ActiveCell.Offset(0, 1).Range("A1").Select
Next

' On Error Resume Next
rst.MoveNext
'On Error GoTo 0 'Resume with Excels standard error
handling

ActiveCell.Offset(1, 0).Range("A1").Select
Wend

This all works fine, until I introduce a field with a type of date
into the SQL. Then the above code will obtain the data, and display
the first record (including the date) in thw workbook. Excellent.

However, as soon as Excel executes the rst.MoveNext command, I get the
following error:


Run-time error '-2147467259 (80004005)':
[Lotus][ODBC Lotus Notes]Data value is not a valid date, time or
timestamp


Is there anyway I can persuage Excel to ignore this error given it has
already shown me the data?

NB "On Error Resume Next" doesn't seem to help (when uncommented) as
rst.EOF becomes True and so I am only ever given the first record.

Any thoughts?

Thanks,

Stew
 

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