Home » Developer & Programmer » Forms » FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500
FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #85756] Tue, 27 July 2004 03:24 Go to next message
Anup
Messages: 12
Registered: April 2002
Junior Member
Hi,

   While running oracle form based on ole concept i am getting above error.

  I am running this form on win NT 4 and form v 5.

 what are changes one should make in registry or at any other place,

or  any different procedure calls that can be used to used this ole object in form.

my code is as follows in when-button-pressed trigger

application ole2.obj_type;
 workbook    ole2.obj_type;
 workbooks   ole2.obj_type;
 worksheet   ole2.obj_type;
 cell        ole2.obj_type;
 setit       ole2.obj_type;

 items       ole2.list_type;
 cells       ole2.list_type;
 filename    ole2.list_type;
 
begin
    application :=ole2.create_obj('Execl.Application');
    ole2.set_property(application,'visible','true');  

   workbooks := ole2.get_obj_property(application,'workbooks');
    workbook := ole2.get_obj_property(workbooks,'Add');
    filename := ole2.create_arglist;
    ole2.add_arg(filename,'c:example.xls');
    ole2.invoke(workbook,'SaveAs',filename);
    ole2.destroy_arglist(filename);
  
/*    worksheet := ole2.get_obj_property(workbook,'worksheets');
    items :=ole2.create_arglist;
    ole2.add_arg(items,1);
    cell := ole2.get_obj_property(worksheet,'item',items);
    cells := ole2.create_arglist;
    ole2.add_arg(cells,1); --row number
    ole2.add_arg(cells,1); --column number
    setit := ole2.get_obj_property(cell,'cells',cells);
   
    ole2.set_property(setit,'value',100);
    :block3.return_value := ole2.get_num_property(setit,'value');
   
    ole2.destroy_arglist(cells);
    ole2.destroy_arglist(items);
*/
    ole2.release_obj(application);
   
exception
  when no_data_found then
    :message := 'successfully completed  ';pause;synchronize;
    commit;
  WHEN OTHERS THEN
    :MESSAGE := SQLERRM||'~'||SQLCODE;

end;

in debugger error is coming after get_object_property,

and handle is returning 0 value.

plz give solutions and suggestions.

thanks in advance.

  

  
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #85768 is a reply to message #85756] Wed, 28 July 2004 04:02 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
Rewrite your code as follows:
DECLARE -- Declare the OLE objects application OLE2.OBJ_TYPE;
workbooks OLE2.OBJ_TYPE;
workbook OLE2.OBJ_TYPE;
worksheets OLE2.OBJ_TYPE;
worksheet OLE2.OBJ_TYPE;
cell OLE2.OBJ_TYPE;
-- Declare handles to OLE argument lists args OLE2.LIST_TYPE;
BEGIN
-- Start Excel and make it visible application:=OLE2.CREATE_OBJ('Excel.Application');

OLE2.SET_PROPERTY(application, 'Visible', 'True');

-- Return object handle to the Workbooks collection workbooks:=OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');

-- Add a new Workbook object to the Workbooks collection workbook:=OLE2.INVOKE_OBJ(workbooks,'Add');

-- Return object handle to the Worksheets collection for the Workbook
worksheets:=OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');

-- Add a new Worksheet to the Worksheets collection worksheet:=OLE2.INVOKE_OBJ(worksheets,'Add');

-- Return object handle to cell A1 on the new Worksheet args:=OLE2.CREATE_ARGLIST;

OLE2.ADD_ARG(args, 1); OLE2.ADD_ARG(args, 1);

cell:=OLE2.INVOKE_OBJ(worksheet, 'Cells', args);

OLE2.DESTROY_ARGLIST(args);

-- Set the contents of the cell to 'Hello Excel!'

OLE2.SET_PROPERTY(cell, 'Value', 'Hello Excel!');

--Release the OLE objects OLE2.RELEASE_OBJ(cell);

OLE2.RELEASE_OBJ(worksheet);

OLE2.RELEASE_OBJ(worksheets);

OLE2.RELEASE_OBJ(workbook);

OLE2.RELEASE_OBJ(workbooks);

OLE2.RELEASE_OBJ(application);

END;

HTH
Regards
Himanshu
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #85775 is a reply to message #85768] Wed, 28 July 2004 05:55 Go to previous messageGo to next message
Anup
Messages: 12
Registered: April 2002
Junior Member
thanks HIMANSHU!!!!!!
its really working!!!!!
can u explin me why at some places get_object_property( ) works
while at some places obj_invoke works( )???
Thanks once again for ur valuable guidance!!!
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #85781 is a reply to message #85775] Wed, 28 July 2004 20:34 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
This is due to difference in Oracle Versions.

Regards
Himanshu
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #85903 is a reply to message #85768] Tue, 10 August 2004 06:43 Go to previous messageGo to next message
EAhola
Messages: 1
Registered: August 2004
Junior Member
Hi,

I've got something similar but with Access and can't seem to fix it by looking at the Excel fix.

Code is below -- I'd sure appreciate any help.

-- Identifies OLE2 MS-ACCESS Automation objects
args OLE2.LIST_TYPE;
application OLE2.OBJ_TYPE;
documents OLE2.OBJ_TYPE;
currentDb OLE2.OBJ_TYPE;
doCmd OLE2.OBJ_TYPE;

-- create instance of ACCESS
application := OLE2.CREATE_OBJ ('Access.Application');
OLE2.SET_PROPERTY(application,'Visible','True');

args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args,'C:ora_sysp50invoiceInvoice.mdb');

currentDb := OLE2.INVOKE_OBJ(application,'OpenCurrentDatabase',args);
OLE2.DESTROY_ARGLIST(args);

doCmd := OLE2.GET_OBJ_PROPERTY(application,'DoCmd');
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-3055 [message #86410 is a reply to message #85768] Tue, 28 September 2004 04:48 Go to previous messageGo to next message
Minas Fragoulis
Messages: 1
Registered: September 2004
Junior Member
Hi there,
I want to have a trigger in my form wich can just open
the outlook and pasting the value from a field into
'To:' in MS Outlook.
Could you pls help me with that code (opening outlook
and geting the e-mail address from a field in a form;)

Thanks in advance
Minas
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-3055 [message #86621 is a reply to message #85903] Thu, 14 October 2004 09:06 Go to previous messageGo to next message
alejandro medina de jesus
Messages: 2
Registered: October 2004
Junior Member
espero que me digan como utilizar el comando WHEN-BUTTON-PRESSED y un ejemplo de como se utiliza
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-3055 [message #86622 is a reply to message #85903] Thu, 14 October 2004 09:08 Go to previous messageGo to next message
alejandro medina de jesus
Messages: 2
Registered: October 2004
Junior Member
espero que me digan que es y como utilizar el comando WHEN-BUTTON-PRESSED y un ejemplo de como se utiliza
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-1065 [message #86802 is a reply to message #86410] Wed, 03 November 2004 19:32 Go to previous messageGo to next message
uha pragathi
Messages: 1
Registered: November 2004
Junior Member
hai
I want to have a trigger in my form wich can just open
the excel and pasting the value to a field into
'from:' MS excel.
Could you pls help me with that code

Thanks in advance
uha
FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #191218 is a reply to message #85756] Tue, 05 September 2006 04:23 Go to previous messageGo to next message
deepankar.sajjan
Messages: 1
Registered: September 2006
Location: Bangalore
Junior Member

Hi,

Iam using the below code in form ( form 10g and Excel 2000)
But iam gettng error as follows:

FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500.

DECLARE -- DECLARE THE OLE OBJECTS 
APPLICATION     OLE2.OBJ_TYPE; 
WORKBOOKS 	OLE2.OBJ_TYPE; 
WORKBOOK 	OLE2.OBJ_TYPE; 
WORKSHEETS 	OLE2.OBJ_TYPE; 
WORKSHEET 	OLE2.OBJ_TYPE; 
CELL 		OLE2.OBJ_TYPE;
ARGS 		OLE2.LIST_TYPE;


-- DECLARE HANDLES TO OLE ARGUMENT LISTS ARGS OLE2.LIST_TYPE; 
BEGIN 
-- START EXCEL AND MAKE IT VISIBLE 
APPLICATION:=OLE2.CREATE_OBJ('EXCEL.APPLICATION'); 
OLE2.SET_PROPERTY(APPLICATION, 'VISIBLE', 'TRUE');

-- RETURN OBJECT HANDLE TO THE WORKBOOKS COLLECTION 
WORKBOOKS:=OLE2.GET_OBJ_PROPERTY(APPLICATION, 'WORKBOOKS'); 

-- ADD A NEW WORKBOOK OBJECT TO THE WORKBOOKS COLLECTION 
WORKBOOK:=OLE2.INVOKE_OBJ(WORKBOOKS,'ADD'); 

-- RETURN OBJECT HANDLE TO THE WORKSHEETS COLLECTION FOR THE WORKBOOK 
WORKSHEETS:=OLE2.GET_OBJ_PROPERTY(APPLICATION, 'WORKSHEETS'); 

-- ADD A NEW WORKSHEET TO THE WORKSHEETS COLLECTION 
WORKSHEET:=OLE2.INVOKE_OBJ(WORKSHEETS,'ADD'); 

-- RETURN OBJECT HANDLE TO CELL A1 ON THE NEW WORKSHEET 
ARGS:=OLE2.CREATE_ARGLIST; 
OLE2.ADD_ARG(ARGS, 1); OLE2.ADD_ARG(ARGS, 1); 
CELL:=OLE2.INVOKE_OBJ(WORKSHEETS, 'CELLS', ARGS); 
OLE2.DESTROY_ARGLIST(ARGS); 

-- SET THE CONTENTS OF THE CELL TO 'HELLO EXCEL!' 

OLE2.SET_PROPERTY(CELL, 'VALUE', 'HELLO EXCEL!'); 

--RELEASE THE OLE OBJECTS 
OLE2.RELEASE_OBJ(CELL); 
OLE2.RELEASE_OBJ(WORKSHEET); 
OLE2.RELEASE_OBJ(WORKSHEETS); 
OLE2.RELEASE_OBJ(WORKBOOK); 
OLE2.RELEASE_OBJ(WORKBOOKS); 
OLE2.RELEASE_OBJ(APPLICATION);

END;

Please l give solutions and suggestions.

Thanks & regards,
Deepankar Sajjan

[Updated on: Sun, 10 September 2006 21:17] by Moderator

Report message to a moderator

Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #192087 is a reply to message #191218] Sun, 10 September 2006 21:20 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem?

Put 'message; pause;' pairs between each line to determine exactly which line is failing so that you can tell us.

David
Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #249767 is a reply to message #192087] Thu, 05 July 2007 16:10 Go to previous messageGo to next message
JennyL
Messages: 1
Registered: July 2007
Junior Member
Hi

I have the same problems, have the error:

FRM 40735:WHEN-BUTTON-PRESSED Trigger Raised unhandled Exception ORA - 305500

I am running this form on win 2000 and form v 6.

My code is the following:
---------------------------------------------------------------
DECLARE

application OLE2.OBJ_TYPE;
workbooks OLE2.OBJ_TYPE;
workbook OLE2.OBJ_TYPE;
worksheets OLE2.OBJ_TYPE;
worksheet OLE2.OBJ_TYPE;
cell OLE2.OBJ_TYPE;
args OLE2.LIST_TYPE;

BEGIN

application := OLE2.CREATE_OBJ('Excel.Application');
message('application->'||application);
OLE2.SET_PROPERTY(application,'Visible','True');
workbooks := OLE2.GET_OBJ_PROPERTY(application,'Workbooks'); --retorna un manejador de objeto
message('workbooks->'||workbooks);
workbook := OLE2.INVOKE_OBJ (workbooks,'Add'); -- ejecuta un método de un OBJ y retorna un manejador de objetos (object handle)
message('workbook->'||workbook);
worksheets := OLE2.GET_OBJ_PROPERTY (workbook,'WorkSheets');
message('worksheets->'||worksheets);
worksheet := OLE2.INVOKE_OBJ(worksheets,'Add');
message('worksheet->'||worksheet);
args := OLE2.CREATE_ARGLIST;
message('args->'||args);
OLE2.ADD_ARG(args,1);
OLE2.ADD_ARG(args,1);
message('after OLE2.ADD_ARG');

cell := OLE2.INVOKE_OBJ(worksheet,'Cell',args);

message('cell->'||cell);
OLE2.DESTROY_ARGLIST(args);
OLE2.SET_PROPERTY(cell,'Value','Hello Excel');
OLE2.RELEASE_OBJ(cell);
OLE2.RELEASE_OBJ(worksheet);
OLE2.RELEASE_OBJ(worksheets);
OLE2.RELEASE_OBJ(workbook);
OLE2.RELEASE_OBJ(workbooks);
OLE2.RELEASE_OBJ(application);

END;
---------------------------------------------------------------------
I believe that my problem here this :

cell := OLE2.INVOKE_OBJ(worksheet,'Cell',args);

After this line it leaves error to me.
Please l give solutions and suggestions.

PDTA: sorry if I am not understood well, I do not write much English, but I read it Smile





[Updated on: Thu, 05 July 2007 16:15]

Report message to a moderator

Re: FRM-40735 WHEN-BUTTON-PRESSED TRIGGER RAISED AN UNHANDLED EXCEPTION ORA-305500 [message #252745 is a reply to message #249767] Thu, 19 July 2007 19:27 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Previous Topic: Deploy Forms 9i applications on Websphere Application Server Ver 6.1.1
Next Topic: Forms 6i to 10g conversion
Goto Forum:
  


Current Time: Tue Dec 06 14:10:33 CST 2016

Total time taken to generate the page: 0.11370 seconds