Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: error handling

Re: error handling

From: colmkav <colmjkav_at_yahoo.co.uk>
Date: Fri, 22 Jun 2007 09:25:28 -0700
Message-ID: <1182529528.951116.9460@m36g2000hse.googlegroups.com>


On 22 Jun, 18:11, sybra..._at_hccnet.nl wrote:
> On Fri, 22 Jun 2007 08:03:05 -0700, colmkav <colmj..._at_yahoo.co.uk>
> wrote:
>
> >How can I return an error back to Access when executing a command to
> >load a file using SQLLOADER and a control file?
>
> >eg
>
> >Execcmd "SQLLDR EQRISK/eq control=Instrument.ctl"

>
> >(where execcmd is a function that executes the command)
>
> Not an Oracle question. Sqlloader returns a non-zero status, and it's
> up to you.
> And you don't disclose what execcmd is doing.
> Apart from that, using an Access application to call VBA to call
> SQLLDR to load an XE database: You are aware you can do this directly
> in Access? If so: Why did you implement this drama?
>
> --
> Sybrand Bakker
> Senior Oracle DBA

Exec does the folliowing:

Public Sub ExecCmd(cmdLine$)

         Dim proc As PROCESS_INFORMATION
         Dim start As STARTUPINFO
         Dim ReturnValue As Integer

         ' Initialize the STARTUPINFO structure:
         start.cb = Len(start)

         ' Start the shelled application:
         ReturnValue = CreateProcessA(0&, cmdLine$, 0&, 0&, 1&, _
            NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)

         ' Wait for the shelled application to finish:
         Do
            ReturnValue = WaitForSingleObject(proc.hProcess, 0)
            DoEvents
         Loop Until ReturnValue <> 258

         ReturnValue = CloseHandle(proc.hProcess)
End Sub Received on Fri Jun 22 2007 - 11:25:28 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US