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: <sybrandb_at_hccnet.nl>
Date: Sat, 23 Jun 2007 09:36:27 +0200
Message-ID: <53jp73545qj1s71a2nrjathcblh9uc4ek1@4ax.com>


On Fri, 22 Jun 2007 09:25:28 -0700, colmkav <colmjkav_at_yahoo.co.uk> wrote:

>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

So, as I said, NOT an Oracle question.
You have 2 options
- either do it *properly* in Access
(by properly I mean: as you are already in Access, use ODBC to connect the destination table to Access, and write a query to insert the file. ODBC has both a text driver and an Oracle driver. Your sqlldr kludge will set up extra connections to the database,and it will need to spawn threads)
- visit a Mickeysoft related newsgroup (or read the docs) to find out what WaitForSingleObject does with a process returning with a non-zero value.
Your issue has NOTHING to do with Oracle. When you car runs out of gasoline, you aren't asking for assistance here either, are you?

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Sat Jun 23 2007 - 02:36:27 CDT

Original text of this message

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