Home » Developer & Programmer » Forms » How Do I find out "in code" what type of operating system a user is running ( XP or 2000 )
( ) 1 Vote
|
|
|
|
|
|
|
|
Re: How Do I find out "in code" what type of operating system a user is running ( XP or 20 [message #169194 is a reply to message #168379] |
Tue, 25 April 2006 13:07   |
keedn
Messages: 12 Registered: April 2006 Location: Phoenix, AZ United States
|
Junior Member |
|
|
O-k so I tried the dk2wutil.dll for the GET_WINDOWS_VERSION and it returned both "windows2000" on the XP machine as well as the 2000 machine.
Below is the actual infomation of the function that is displayed when running the function in builder.
/*
Get Windows Version returns the current version of windows as a string. One of the following values (note the case) will be returned:
Windows95
Windows98
WindowsNT
Windows2000
Arguments:
(NONE)
Returns: String containing the Windows Version in the format above
*/
I am thinking that the D2KWUTIL is not yet able to recognize XP yet.
So basically i am lost, again.
Thanks for the help
Tom.
|
|
|
|
|
Re: How Do I find out "in code" what type of operating system a user is running ( XP or 20 [message #169613 is a reply to message #169442] |
Thu, 27 April 2006 14:38   |
keedn
Messages: 12 Registered: April 2006 Location: Phoenix, AZ United States
|
Junior Member |
|
|
Wow, thanx alot .... you really helped me learn alot in these past few posts.
I really got lost with this situation...I am a very novice programmer just hired out of college with a state agency here in Phoenix, Arizona U.S.A. All of your assistance has helped me grow as a programmer / analyst. Keep up the good work.
- oh I will look into your last suggestion, and will get back to you later.
- TOM.
-by the way the "START WORD" code that I currently have is below:
IF :GLOBAL.APPLICATION_ID IS NOT NULL THEN
MESSAGE('Application is already running.');
ELSE
appl_name := 'C:\Program Files\Microsoft Office\Office\WINWORD.EXE';
:GLOBAL.application_id := DDE.APP_BEGIN(appl_name, DDE.APP_MODE_MAXIMIZED);
END IF;
- MY QUESTION IS IT POSSIBLE TO JUST HAVE LIKE AN ELSIF STATEMENT OR SOMETHING TO THAT AFFECT TO SAY TAKE THE ABOVE PATH AND IF 'WINWORD.EXE' ISN'T THERE GO TO
'C:\Program Files\Microsoft Office\Office11\WINWORD.EXE' .... JUST A THOUGHT. PLEASE ADVISE.
[Updated on: Thu, 27 April 2006 15:49] Report message to a moderator
|
|
|
|
Re: How Do I find out "in code" what type of operating system a user is running ( XP or 20 [message #170242 is a reply to message #169938] |
Tue, 02 May 2006 17:35   |
keedn
Messages: 12 Registered: April 2006 Location: Phoenix, AZ United States
|
Junior Member |
|
|
David, Sorry again, but I am completely feeling stupid.
How do I start both directories.
this is the original code I have to start the WINDOWS 2000 directory.
IF :GLOBAL.APPLICATION_ID IS NOT NULL THEN
MESSAGE('Application is already running.');
ELSE
appl_name := 'C:\Program Files\MicrosoftOffice\Office\WINWORD.EXE';
:GLOBAL.application_id := DDE.APP_BEGIN(appl_name, DDE.APP_MODE_MAXIMIZED);
END IF;
|
|
|
|
|
|
Re: How Do I find out "in code" what type of operating system a user is running ( XP or 20 [message #170685 is a reply to message #170248] |
Thu, 04 May 2006 16:17   |
keedn
Messages: 12 Registered: April 2006 Location: Phoenix, AZ United States
|
Junior Member |
|
|
Ok, so I tried the following to start one of the directories:
IF :GLOBAL.APPLICATION_ID IS NOT NULL THEN
MESSAGE('Application is already running.');
ELSE
-- one
appl_name := 'C:\Program Files\Microsoft Office\Office\WINWORD.EXE';
:GLOBAL.application_id := DDE.APP_BEGIN(appl_name, DDE.APP_MODE_MAXIMIZED);
-- two
appl_name := 'C:\Program Files\Microsoft Office\Office11\WINWORD.EXE';
:GLOBAL.application_id := DDE.APP_BEGIN(appl_name, DDE.APP_MODE_MAXIMIZED);
END IF;
= The XP machine has the "Office11" directory and the code above runs on the XP machine. When trying to run the above on the 2000 machine with the basic "office" directory on top it does not get run. Nothing happens. - But if I switch the directories on the 2000 machine to have the "office" for the second "appl_name" it runs.
= So basically which ever one is called last and is on the machine with the directory specified, gets ran.
= Man O Man am I so clueless on this one. Thanks for all the help. It sure is appreciated. - Dude were damn near starting to write a book here.
[Updated on: Thu, 04 May 2006 16:22] Report message to a moderator
|
|
|
|
|
Re: How Do I find out "in code" what type of operating system a user is running ( XP or 20 [message #170892 is a reply to message #170860] |
Fri, 05 May 2006 16:54   |
keedn
Messages: 12 Registered: April 2006 Location: Phoenix, AZ United States
|
Junior Member |
|
|
BEGIN
DECLARE
appl_name varchar2(255);
appl_name2 varchar2(255);
docid pls_integer;
ws_current_date varchar2(60);
ws_current_day_year varchar2(20);
ws_current_month varchar2(20);
hold_city varchar2(20);
hold_st varchar2(02);
hold_zipcode varchar2(10);
hold_street varchar2(100);
hold_lab_dir_firstname varchar2(25);
hold_lab_dir_lastname varchar2(25);
hold_lab_dir_salutation varchar2(15);
ws_city_st_zip varchar2(50);
ws_lab_dir_name varchar2(75);
ws_lab_dir_salutation varchar2(75);
ws_user_name varchar2(20);
ws_password_name varchar2(20);
ws_connect_string_name varchar2(20);
BEGIN
ws_user_name := get_application_property(username);
ws_password_name := get_application_property(password);
ws_connect_string_name := get_application_property(connect_string);
select
mailcity,
mailst,
mailzip,
mailstreet,
lab_dir_firstname,
lab_dir_lastname,
lab_dir_salutation
into
hold_city,
hold_st,
hold_zipcode,
hold_street,
hold_lab_dir_firstname,
hold_lab_dir_lastname,
hold_lab_dir_salutation
from h64laboratory_details
where :h64laboratory_details.azlicense = azlicense;
ws_city_st_zip := hold_city||', '||hold_st||' '||hold_zipcode;
If substr(hold_lab_dir_lastname,1,2) = 'Mc' or
substr(hold_lab_dir_lastname,1,2) = 'MC' then
If substr(hold_lab_dir_salutation,1,3) = 'Dr.' then
ws_lab_dir_name := hold_lab_dir_firstname||' '||substr(hold_lab_dir_lastname,1,2)||
substr(hold_lab_dir_lastname,3,23)||', Ph.D';
Else
ws_lab_dir_name := hold_lab_dir_salutation||' '||hold_lab_dir_firstname||' '||
substr(hold_lab_dir_lastname,1,2)||substr(hold_lab_dir_lastname,3,23);
End if;
ws_lab_dir_salutation := hold_lab_dir_salutation||' '||
substr(hold_lab_dir_lastname,1,2)||
substr(hold_lab_dir_lastname,3,23)||':';
ELSE
If substr(hold_lab_dir_salutation,1,3) = 'Dr.' then
ws_lab_dir_name := hold_lab_dir_firstname||' '||hold_lab_dir_lastname||', Ph.D';
Else
ws_lab_dir_name := hold_lab_dir_salutation||' '||hold_lab_dir_firstname||' '||
hold_lab_dir_lastname;
End if;
ws_lab_dir_salutation := hold_lab_dir_salutation||' '||hold_lab_dir_lastname||':';
End if;
-- START WORD
IF :GLOBAL.APPLICATION_ID IS NOT NULL THEN
MESSAGE('Application is already running.');
ELSE
-- FIST DIRECTORY ON WINDOWS 2000
appl_name := 'C:\Program Files\Microsoft Office\Office\WINWORD.EXE';
:GLOBAL.application_id := DDE.APP_BEGIN(appl_name, DDE.APP_MODE_MAXIMIZED);
-- SECOND DIRECTORY ON WINDOWS XP
appl_name := 'C:\Program Files\Microsoft Office\Office11\WINWORD.EXE';
:GLOBAL.application_id := DDE.APP_BEGIN(appl_name, DDE.APP_MODE_MAXIMIZED);
END IF;
-- Establishing a DDE communication channel (between Form Builder & a topic in the application server.
If :GLOBAL.channel_id IS NOT NULL THEN
MESSAGE('Communication channel already established.');
ELSIF
:GLOBAL.application_id IS NULL THEN
MESSAGE('Application must be launched first.');
ELSE
-- INITIATE CONVERSATION WITH WORD
:GLOBAL.channel_id := DDE.INITIATE('WINWORD','SYSTEM');
-- OPEN WORD TEMPLATE
If
ws_user_name = 'H64ELBIS' or
ws_user_name = 'H31SECURITY' then
DDE.EXECUTE(:GLOBAL.channel_id,'[FileOpen "F:\ELBIS\LETTERS\ACCEPTANCE_LETTER.DOC"]',10000);
Else
DDE.EXECUTE(:GLOBAL.channel_id,'[FileOpen "G:\Env\LETTERS\ACCEPTANCE_LETTER.DOC"]',10000);
End if;
--INITIATE CONVERSATION WITH WORD TEMPLATE
If ws_user_name = 'H64ELBIS' or
ws_user_name = 'H31SECURITY' then
DOCID := DDE.INITIATE('WINWORD','F:\ELBIS\LETTERS\ACCEPTANCE_LETTER.DOC');
Else
DOCID := DDE.INITIATE('WINWORD','G:\Env\LETTERS\ACCEPTANCE_LETTER.DOC');
End if;
END IF;
--BEGIN TRANSFER TO WORD
select to_char(sysdate, 'Month') into ws_current_month from dual;
ws_current_month := rtrim(ws_current_month);
select to_char(sysdate, 'DD, YYYY') into ws_current_day_year from dual;
ws_current_date := ws_current_month||' '||ws_current_day_year;
DDE.POKE(DOCID,'TODAYS_DATE',ws_current_date,DDE.CF_TEXT,10000);
DDE.POKE(DOCID,'LAB_DIRECTOR_NAME',nvl(ws_lab_dir_name, ' '),DDE.CF_TEXT,10000);
DDE.POKE(DOCID,'LAB_NAME',:h64laboratory_details.labname,DDE.CF_TEXT,10000);
DDE.POKE(DOCID,'STREET_ADDRESS',nvl(hold_street, ' '),DDE.CF_TEXT,10000);
DDE.POKE(DOCID,'CITY_STATE_ZIP',nvl(ws_city_st_zip, ' '),DDE.CF_TEXT,10000);
DDE.POKE(DOCID,'LICENSE_NUMBER',rtrim(:h64laboratory_details.azlicense),DDE.CF_TEXT,10000);
DDE.POKE(DOCID,'SALUTATION',nvl(ws_lab_dir_salutation, ' '),DDE.CF_TEXT,10000);
DDE.POKE(DOCID,'LAB_NAME2',:h64laboratory_details.labname,DDE.CF_TEXT,10000);
--SAVE THE TEMPLATE
-- DDE.EXECUTE(DOCID,'[FileSaveAs "F:\ELBIS\LETTERS\ACCEPTANCE_LETTER.DOC"]',10000);
--END TRANSFER TO WORD
DDE.TERMINATE(:GLOBAL.channel_id);
:GLOBAL.channel_id := null;
:GLOBAL.application_id := null;
--HANDLE EXCEPTIONS
EXCEPTION
WHEN DDE.DDE_APP_FAILURE THEN
MESSAGE('Word for Windows cannot start.');
RAISE FORM_TRIGGER_FAILURE;
WHEN DDE.DDE_PARAM_ERR THEN
MESSAGE('A Null value was passed to DDE');
RAISE FORM_TRIGGER_FAILURE;
WHEN DDE.DDE_INIT_FAILED THEN
MESSAGE('Could not initialize DDE communication channel.');
RAISE FORM_TRIGGER_FAILURE;
WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
MESSAGE('Could not establish DDE communication channel.');
RAISE FORM_TRIGGER_FAILURE;
WHEN DDE.DMLERR_NOTPROCESSED THEN
MESSAGE('A Transaction Failed.');
RAISE FORM_TRIGGER_FAILURE;
WHEN OTHERS THEN
MESSAGE('Error: '||TO_CHAR(SQLCODE)||' '||SQLERRM);
RAISE FORM_TRIGGER_FAILURE;
END;
END; Upd-mod: Added 'code' tags.
[Updated on: Sat, 06 May 2006 00:34] by Moderator Report message to a moderator
|
|
|
|
Re: How Do I find out "in code" what type of operating system a user is running ( XP or 20 [message #171837 is a reply to message #170938] |
Thu, 11 May 2006 13:04  |
keedn
Messages: 12 Registered: April 2006 Location: Phoenix, AZ United States
|
Junior Member |
|
|
I FINALLY FIGURED IT OUT:
WITHIN THE ACTUAL FORM MODULE I ADDED AN ADDITIONAL PROGRAM UNIT OF FUNCTION AN ATTATCHED IT : ( the function is named HelloFile and uses a BOOLEAN return type with the TEXT_IO to test if it can actually open the file.
FUNCTION HelloFile (p_filename VARCHAR2) RETURN BOOLEAN IS
-- p_filename variable will hold the value of the directory specified in the trigger IF statement
fileID TEXT_IO.FILE_TYPE;
BEGIN
fileID := TEXT_IO.FOPEN(p_filename, 'r');
TEXT_IO.FCLOSE(fileID);
RETURN TRUE;
EXCEPTION
WHEN others THEN
RETURN FALSE;
END HelloFile;
- THE FUNCTION ABOVE GETS CALLED FROM A BUTTON TRIGGER THAT USES THE IF STATEMENT OF:
-- START WORD
IF :GLOBAL.APPLICATION_ID IS NOT NULL THEN
MESSAGE('Application is already running.');
ELSE
IF HelloFile('C:\Program Files\Microsoft Office\Office\WINWORD.EXE') THEN
-- the above directory is then stored in the (p_filename) of the function HelloFile
-- to see if it can be opened, IF SO then open the directory as below
-- IF NOT then go to the else statement and process the next directory to open word.
appl_name := 'C:\Program Files\Microsoft Office\Office\WINWORD.EXE';
:GLOBAL.application_id := DDE.APP_BEGIN(appl_name, DDE.APP_MODE_MAXIMIZED);
ELSE
appl_name := 'C:\Program Files\Microsoft Office\Office11\WINWORD.EXE';
:GLOBAL.application_id := DDE.APP_BEGIN(appl_name, DDE.APP_MODE_MAXIMIZED);
END IF;
END IF;
[Updated on: Thu, 11 May 2006 13:06] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Mar 08 19:01:20 CST 2025
|