Solved

Calling Oracle Form that uses DDE on remote computer

Posted on 2003-11-03
2
960 Views
Last Modified: 2007-12-19
Hi, I have a problem. I call an Oracle form from remote computer, that uses DDE(Dynamic Data Exchange) and transfer data from form to MS Excel. If I run this form on my computer, everything is OK, but if I call this form from remote computer, I get a message "WINDOWS APPLICATION CANNOT START". Can you help me to find what is wrong?
The code is:
/* Declare variables */
DECLARE
appid PLS_INTEGER;
convid PLS_INTEGER;
docid PLS_INTEGER;
i number;
l number;
filename varchar(150);
systime varchar(100);
rowcol2 varchar(5);
rowcol3 varchar(5);
rowcol4 varchar(5);
rowcol5 varchar(5);
rowcol6 varchar(5);
rowcol7 varchar(5);
rowcol8 varchar(5);

conv_established BOOLEAN := FALSE;
/* Begin trigger DDE sample */
BEGIN

/* Start Excel */
/* This line assumes that Excel is in the directory C:\Program Files\Microsoft Office\Office\excel.exe */

APPID := DDE.APP_BEGIN('\\Sit-zbabic\Poziv_izvjestaja\Excel dokumenti\excel.exe',
--APPID := DDE.APP_BEGIN('C:\Program Files\Microsoft Office\Office\excel.exe',
DDE.APP_MODE_MINIMIZED);

/* Establish a conversation with Excel */
/* The following loop will not end until a conversation with Excel
has been established. Therefore, it can result in a endless loop,
so use with caution. */
WHILE NOT conv_established LOOP
BEGIN
convid := DDE.INITIATE('excel', 'system');
conv_established := TRUE;
EXCEPTION
WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
conv_established := FALSE;
END; -- loop
END LOOP;

/* Open Excel document */
/* This assumes that you have an Excel spreadsheet named ddetest.xls
in the root of e: */
--DDE.EXECUTE(convid, '[Open("D:\Ora_Forms\PROBE\FORMS TO EXCEL\pregled_radnika.xls")]', 10000);
DDE.EXECUTE(convid, '[Open("\\Sit-zbabic\Poziv_izvjestaja\Excel dokumenti\pregled_radnika.xls")]', 10000);

/* Initiate conversation with Excel document */
--docid := DDE.INITIATE('excel', 'D:\Ora_Forms\PROBE\FORMS TO EXCEL\pregled_radnika.xls');
docid := DDE.INITIATE('excel', '\\Sit-zbabic\Poziv_izvjestaja\Excel dokumenti\pregled_radnika.xls');

/* process putting of data into an excel worksheet*/
   
  go_block('REZULTAT_PRETRAGE');
i :=2;
while :RADNIK_ID is not null loop
 
   rowcol2 := 'R' || to_char(i) || 'C2';
   rowcol3 := 'R' || to_char(i) || 'C3';
   rowcol4 := 'R' || to_char(i) || 'C4';
   rowcol5 := 'R' || to_char(i) || 'C5';
   rowcol6 := 'R' || to_char(i) || 'C6';
   rowcol7 := 'R' || to_char(i) || 'C7';
   rowcol8 := 'R' || to_char(i) || 'C8';  
   

/* Begin transfer to Excel */
DDE.POKE(docid, rowcol2,:RADNIK_ID, DDE.CF_TEXT, 1000);
If :PREZIME is null then
  DDE.POKE(docid, rowcol3,'-', DDE.CF_TEXT, 1000);
Else
      DDE.POKE(docid, rowcol3,:PREZIME, DDE.CF_TEXT, 1000);
End if;
If :IME_OCA is null then
  DDE.POKE(docid, rowcol4,'-', DDE.CF_TEXT, 1000);
Else
      DDE.POKE(docid, rowcol4,:IME_OCA, DDE.CF_TEXT, 1000);
End if;      

If :IME is null then
  DDE.POKE(docid, rowcol5,'-', DDE.CF_TEXT, 1000);
Else
      DDE.POKE(docid, rowcol5,:IME, DDE.CF_TEXT, 1000);
End if;
If :DJEVOJACKO_PREZIME is null then
  DDE.POKE(docid, rowcol6,'-', DDE.CF_TEXT, 1000);
Else
      DDE.POKE(docid, rowcol6,:DJEVOJACKO_PREZIME, DDE.CF_TEXT, 1000);
End if;
If :POL is null then
  DDE.POKE(docid, rowcol7,'-', DDE.CF_TEXT, 1000);
Else
      DDE.POKE(docid, rowcol7,:POL, DDE.CF_TEXT, 1000);
End if;
If :JMB is null then
  DDE.POKE(docid, rowcol8,'-', DDE.CF_TEXT, 1000);
Else
      DDE.POKE(docid, rowcol8,:JMB, DDE.CF_TEXT, 1000);
End if;
i := i + 1;
next_record;
 end loop;
systime := to_char(sysdate,'DD-MON-YY hh-mi-ssam');
filename := '\\Sit-zbabic\Poziv_izvjestaja\Excel dokumenti\pregled_radnika' || systime || '.xls';
--filename := 'D:\Ora_Forms\PROBE\FORMS TO EXCEL\pregled_radnika' || systime || '.xls';
DDE.EXECUTE(convid, '[Save.As("' || filename || '")]', 10000);
--DDE.EXECUTE(convid, '[Save.As("D:\Ora_Forms\PROBE\FORMS TO EXCEL\pregled_radnika1.xls")]', 10000);
/*End transfer to Excel */
DDE.TERMINATE(docid);
DDE.TERMINATE(convid);
DDE.APP_END(appid);

/* Handle exceptions */
EXCEPTION
WHEN DDE.DDE_APP_FAILURE THEN
MESSAGE('WINDOWS APPLICATION CANNOT START.');
WHEN DDE.DDE_PARAM_ERR THEN
MESSAGE('A NULL VALUE WAS PASSED TO DDE');
WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
MESSAGE('DDE CANNOT ESTABLISH A CONVERSATION');
WHEN DDE.DMLERR_NOTPROCESSED THEN
MESSAGE('A TRANSACTION FAILED');

/* End of trigger */
END;
     
0
Comment
Question by:dragy
2 Comments
 
LVL 2

Accepted Solution

by:
doryllis earned 125 total points
ID: 9674574
It may be using an Excel component to do the export.  Is Excel installed on the Remote computer in the directory that is listed above?

When you launch on the remote computer do you have mappings that match the required mapping based on the script?

This line seems to indicate that you are launching Excel directly on your local computer or from a network share rather than from the C:\Program files directory that has been commented out.  I would bet that this is where your error is.  Does the other computer/remote user have access to this computer at this path?
APPID := DDE.APP_BEGIN('\\Sit-zbabic\Poziv_izvjestaja\Excel dokumenti\excel.exe'

try uncommenting this line in your code and see if it changes:
--APPID := DDE.APP_BEGIN('C:\Program Files\Microsoft Office\Office\excel.exe',

There is also a reference further down that is the same way (a previous default commented out and a new more specific path put in place). Without having seen this App get to that point I would also suspect that as a point of failure.

Good Luck,
Dory
0
 
LVL 1

Author Comment

by:dragy
ID: 9676742
Hi Dory, thank you very, very much. This is solution of my problem. When I call form thru the web, remote computer executes all triggers on own local.

Thanks
Dragi
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 112
no14 challenge 14 62
method argument as final 1 74
mapBully challenge 6 115
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now