Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> read data from an excel-sheet using Oracle Forms
Hello Professionals,
I have problems to read data from an excel-sheet using Oracle Forms. I will show you the code I use on an Pentium 266MHz with Windows NT 4.0 with service pack 3.
The code is inside a when-mouse-click trigger:
DECLARE
app_name Varchar2(60);
app_id PLS_INTEGER;
ChannelId PLS_INTEGER;
name VARCHAR2(160);
file_name VARCHAR2(100);
buffer VARCHAR2;
BEGIN
:GLOBAL.application_ID := null;
:GLOBAL.channel_id := null;
if :GLOBAL.application_id is NOT NULL then
Message ('Anwendung Excel schon gestartet');
else
app_name := 'C:\PROGRA~1\MICROS~1\OFFICE\EXCEL.EXE';
file_name := 'C:\TEMP\TESTXLS.XLS';
name := app_name || ' ' ||file_name;
-- Message('Anwendung ' || app_name|| ' '||filename);
app_id := DDE.APP_BEGIN(name, DDE.APP_MODE_NORMAL);
MESSAGE('APP_ID: '||to_char(app_ID));
ChannelId := DDE.INITIATE('Microsoft EXCEL', 'C:\TEMP\TESTXLS.XLS');
MESSAGE('APP_ID: '||to_char(app_ID)||' Channel_ID:
'||to_char(ChannelId));
-- DDE.Poke(ChannelId, 'R1C1','TESTText', DDE.CF_TEXT, 10000);
Message('Excel: <'||buffer||'>');synchronize;
DDE.TERMINATE (ChannelId);
DDE.APP_END (app_id);
end if;
EXCEPTION
-- when DDE.DMLERR_NOT_SUPPORTED then
Does anyone know how to solve this problem? I want to read Information like this out of Excel:
date1
header1_string header2_string header3_string
textstring1 numericvalue1 numericvalue2
:
textstringn numericvalue1n numericvalue2n
date2
header1_string header2_string header3_string
textstring1 numericvalue1 numericvalue2
:
textstringm numericvalue1m numericvalue2m
Is there a better idea instead of using DDE? What about OLE or ODBC for this problem? Please answer me in the newsgroup or email me to kopetzkyike.uni-stuttgart.de <mailto:tischendorf_at_arkusa.de>
Thanks a lot. Any help is welcome because I do not have other ideas how to solve this.
Roland Kopetzky
--
Postfach - 70550 Stuttgart II KK KK EEEEEE Pfaffenwaldring 31, D - 70569 Stuttgart II KK KK EE II KKKK EEEEE Phone: +49 711/685-2135 II KK KK EE Fax: +49 711/685-2010 II KK KK EEEEEEE-Mail: kopetzky_at_ike.uni-stuttgart.de
![]() |
![]() |