Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A few simple questions...
Message
 
To
10/04/2002 04:06:26
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00643030
Message ID:
00643077
Views:
7
Thank you very much - the commenting / un-commenting tip is invaluable!!!

Thanks also for the link - I have a further question about something the article raises...

"If you use class modules in your apps, Microsoft recommends that you handle errors silently within the class. You shouldn't use MsgBox output for error notification within a class module. If you can't resolve an error in code within the class, re-raise an error (also called regenerating the error) to the calling routine for handling. You can map the error condition to an existing error number, or you can create a custom error number with your own description."

I use a module to open recordsets so I have this...
Call GetRSRO(rs, "select * from system where sy_primary = 1")
Here's the module code...
Option Explicit
Public Sub GetRSRO(rsGetName As ADODB.Recordset, strSQL As String)
Dim intanswer As Integer
On Error GoTo ErrHandler
'get a readonly recordset
Set rsGetName = New ADODB.Recordset
rsGetName.Open strSQL, DB, adOpenStatic, adLockReadOnly, adCmdText

ErrHandler:
If Err.Number = -2147467259 Then
intanswer = MsgBox("     Unable to open the database at this time...          ", vbRetryCancel + vbCritical, oAppName)
Err.Clear
If intanswer = vbRetry Then
'retry code here
Else
MsgBox "" & oAppName & " will now close - please launch " & oAppName & " and try again...          "
ShutDown
End If
Else
MsgBox "     An error has occurred - Error number: " & Err.Number & " Error description: " & Err.Description & " Error source: " & Err.Source
Err.Clear
End If
End Sub
Now the article talks about not doing this but to pass the error back to the calling sub - how do I do this? The calling sub is expecting a recordset back...

Any ideas?
Chris Maiden
Email
Web
Previous
Reply
Map
View

Click here to load this message in the networking platform