In a VB 6 program I get 'Error 91 object variable or with block variable not set'. The code is below and the error occurs on line 1020. A class is used, it is declared as a new class in a module.
If more info is needed please let me know, your help is appreciated.
In a module I declare:
Public cbDataConn As New clsDB
Private Sub CheckMail()
1000 Dim rst As Recordset
1010 On Error GoTo ErrHandler
**1020 If IsNull(rsLocal("CurrentOperatorID")) Or RestoringRun Then
1030 Exit Sub
1040 End If
1050 Set rst = cbDataConn.GetData("SELECT * FROM viewOpMail WHERE ViewedAt is NULL AND Retired=0 and OperatorID=" & rsLocal("CurrentOperatorID") & " ORDER BY SentAt ASC")
Anything on that line could be the problem...rsLocal isnn't declared or instantiated. I don't see where RestoringRun is declared or instantiated.
Can you put a breakpoint on that line, run the program and, when it stops, hover your mouse over those items? If they are "Nothing" then that is the problem. You may have to highlight then and Shift-F9 (Quick watch in VS6)
There is a Debug.print in the initialize and I don't see problems there. The funny thing is this used to work fine, no major code changes have been done for awhile. So I installed the Q331953 patch on a couple of the individual machines to see if it would helphttp://www.microsoft.com/downloads/d...displaylang=en)
After reviewing the error log again here are other errors that starting occuring at the same time:
Method cannot be invoked on business object.
Error 4101 in clsDB::GetRS
Error 4101 in clsDB:aveRS
Business object cannot be created.
Error 4100 in clsDB::Execute
Error 4100 in modGlobal::ConvertNumeric