Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Calling Oracle Form that uses DDE on remote computer

Posted on 2003-11-03
2
Medium Priority
?
1,007 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
doryllis earned 500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

618 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