B
Bernardo
Hi all !!!
I'm having a problem handling an error when importing an Oracle table
into Access 2007. The VBA code I'm using is something like this:
Sub ImportOracle()
Dim db As Database
Dim strSQL As String
On Error GoTo ErrHandler
strSQL = "SELECT * INTO ***** FROM
[ODBC;DSN=PeopleSoft;DBQ=*****;ID=*****;PWD=*****;].[PUBLIC.*****]"
Set db = CurrentDb
Call db.Execute(strSQL)
ExitPoint:
Set db = Nothing
Exit Sub
ErrHandler:
IOMsgDB "", "ERROR importing PeopleSoft (" & Err.Number & ": " &
Err.Description & ")"
Resume ExitPoint
End Sub
The problem is that if some reason the Oracle database is not
available, the process hangs with a window from the Oracle ODBC asking
for username and password (already filled). And only after accepting
that window, the code continues handling the error.
Does anybody know any way to avoid this?? Any help would be greatly
appreciated !!!
Thank you !!!
I'm having a problem handling an error when importing an Oracle table
into Access 2007. The VBA code I'm using is something like this:
Sub ImportOracle()
Dim db As Database
Dim strSQL As String
On Error GoTo ErrHandler
strSQL = "SELECT * INTO ***** FROM
[ODBC;DSN=PeopleSoft;DBQ=*****;ID=*****;PWD=*****;].[PUBLIC.*****]"
Set db = CurrentDb
Call db.Execute(strSQL)
ExitPoint:
Set db = Nothing
Exit Sub
ErrHandler:
IOMsgDB "", "ERROR importing PeopleSoft (" & Err.Number & ": " &
Err.Description & ")"
Resume ExitPoint
End Sub
The problem is that if some reason the Oracle database is not
available, the process hangs with a window from the Oracle ODBC asking
for username and password (already filled). And only after accepting
that window, the code continues handling the error.
Does anybody know any way to avoid this?? Any help would be greatly
appreciated !!!
Thank you !!!