Kdbailey
Board Regular
- Joined
- Aug 1, 2012
- Messages
- 156
Hello,
What I'm looking for is a way to suppress the Analysis Services Connection wizard from popping up if a user inputs an incorrect variable for a OLEDB connection.
Basically I have 3 variables. Server, cube and user. I build the connection and then prior to using it, I test it by using Workbookconnection.OLEDB.Reconnect. If all three are valid it reconnects with no error. If one of the three are invalid, a wizard pops up. Is there any way to suppress the wizard? I'd rather it just log the error.
What I'm looking for is a way to suppress the Analysis Services Connection wizard from popping up if a user inputs an incorrect variable for a OLEDB connection.
Basically I have 3 variables. Server, cube and user. I build the connection and then prior to using it, I test it by using Workbookconnection.OLEDB.Reconnect. If all three are valid it reconnects with no error. If one of the three are invalid, a wizard pops up. Is there any way to suppress the wizard? I'd rather it just log the error.
Code:
conn.OLEDBConnection.Reconnect
If Err.Number = 91 Or Err.Number = 1004 Then
'Account Error
errfree = False
logstr = "Error: Account '" & singlerole.Value & "' is not connecting. Please check the account is correct or exists."
logresult = Logger(logstr)
GoTo skip
ElseIf Err.Number <> 0 Then
'Unknown Error
errfree = False
logstr = "Unknown Error: Account '" & singlerole.Value & "' is not connecting. Please check the server, cube and account are correct."
logresult = Logger(logstr)
GoTo skip
Else
logstr = "Success initializing connection for Account: '" & singlerole.Value & "'"
logresult = Logger(logstr)
End If
Err.Clear
Last edited: