Help sought with RfcConnect C call to MDIS RealityX

Help sought with RfcConnect C call to MDIS RealityX

Post by I Re » Fri, 16 Aug 1996 04:00:00



I am trying to make use of the Unix-Connect C programmers interface to a
healthcare system running the MDIS PAS system (Reality X database) and would
appreciate any help on offer.

1. The target system has a common logon account (Unix) called unix_account.
2. It does not have a password for unix_password.
3. Reality then prompts for a unique user_id and unique user_password.
4. The database is called db_name.

From reading the manual and trying the sample code I would have thought that
something like this:

RfcConnect (dbname, unix_account, unix_password, user_id, user_password) would
successfully connect. Instead it sits there for about a minute and then times
out.

Any idea why? The user manual declines to comment.

Thanks,
      Iain

p.s. No comments please about the security of not having a Unix password. I'm
no happier about it than you.

 
 
 

Help sought with RfcConnect C call to MDIS RealityX

Post by Terry A. Johns » Fri, 16 Aug 1996 04:00:00


: I am trying to make use of the Unix-Connect C programmers interface to a
: healthcare system running the MDIS PAS system (Reality X database) and would
: appreciate any help on offer.

: 1. The target system has a common logon account (Unix) called unix_account.
: 2. It does not have a password for unix_password.
: 3. Reality then prompts for a unique user_id and unique user_password.
: 4. The database is called db_name.

: From reading the manual and trying the sample code I would have thought that
: something like this:

: RfcConnect (dbname, unix_account, unix_password, user_id, user_password) would
: successfully connect. Instead it sits there for about a minute and then times
: out.

: Any idea why? The user manual declines to comment.

: Thanks,
:       Iain

: p.s. No comments please about the security of not having a Unix password. I'm
: no happier about it than you.

I have had to help people with this before so I happen to have a handy
example program all ready for you.  I think the problem is that where you
say "unix_account" and "unix_password", RfcConnect is looking for the
Reality "user".  That is the thing that the Reality PASSWORD verb with
no options changes.  Where you say "user_id" and "user_password", it is
expecting the Reality account name and password.  The unix user-id does
not figure into the call to RfcConnect.  In my example below, the $REALUSER
environment variable has the Reality user name and the account name is CORA.

(I put a lot of gotos in the program to annoy people who don't like them.)

Terry Johnson
ADP Dealer Services

------------------------------------------------------------------------------
/*
 * This program is a simple example of how to use CoRA file services.
 * Create the files TESTFILE1 and TESTFILE2 on the CORA account,
 * put a couple short items, A and B, in each file, and run this program.
 */

#include <stdio.h>
#include "rgc.h"
#include "rfc.h"

main()
{
    int result, len;
    RFC_FILE FileHandle1, FileHandle2;
#define BUF_SIZE 10000
    char item_buffer[ BUF_SIZE ];

    printf( "Starting up services\r\n" );
    RgcStartUpServices( result );
    if ( result ){
        printf( "Start up services failed, code = %d\r\n", result );
        exit( 1 );
    }

    printf( "Connecting to database\r\n" );
    if ( result = RfcConnect( getenv( "REALDBASE" ), getenv( "REALUSER" ),
                                                NULL, "CORA", NULL ) ){
        printf( "RfcConnect failed, code = %d\r\n", result );
        goto shutdown;
    }

    printf( "Opening TESTFILE1\r\n" );
    if ( result = RfcOpenFile( "TESTFILE1", &FileHandle1 ) ){
        printf( "Open of TESTFILE1 failed, code = %d\r\n", result );
        goto disconnect;
    }

    printf( "Opening TESTFILE2\r\n" );
    if ( result = RfcOpenFile( "TESTFILE2", &FileHandle2 ) ){
        printf( "Open of TESTFILE2 failed, code = %d\r\n", result );
        goto disconnect;
    }

    printf( "Reading item A from TESTFILE1\r\n" );
    if ( result = RfcRead( FileHandle1, "A", 1, item_buffer, BUF_SIZE, &len ) ){
        printf( "Failure reading item\r\n" );
        goto close;
    }

    printf( "Reading item B from TESTFILE1\r\n" );
    if ( result = RfcRead( FileHandle1, "B", 1, item_buffer, BUF_SIZE, &len ) ){
        printf( "Failure reading item\r\n" );
        goto close;
    }

    printf( "Reading item A from TESTFILE2\r\n" );
    if ( result = RfcRead( FileHandle2, "A", 1, item_buffer, BUF_SIZE, &len ) ){
        printf( "Failure reading item\r\n" );
        goto close;
    }

    printf( "Reading item B from TESTFILE2\r\n" );
    if ( result = RfcRead( FileHandle2, "B", 1, item_buffer, BUF_SIZE, &len ) ){
        printf( "Failure reading item\r\n" );
        goto close;
    }

close:
    printf( "Closing TESTFILE1\r\n" );
    if ( result = RfcClose( FileHandle1 ) ){
        printf( "Close of TESTFILE1 failed, code = %d\r\n", result );
        goto disconnect;
    }

    printf( "Closing TESTFILE2\r\n" );
    if ( result = RfcClose( FileHandle2 ) ){
        printf( "Close of TESTFILE2 failed, code = %d\r\n", result );
        goto disconnect;
    }

disconnect:
    printf( "Disconnecting from database\r\n" );
    if ( result = RfcDisconnect() ){
        printf( "Disconnect failed, code = %d\r\n", result );
    }

shutdown:
    printf( "Shutting down services\r\n" );
    RgcShutDownServices();
    if ( result )
        exit( 1 );
    else
        exit( 0 );

Quote:}


 
 
 

1. MDIS RealityX and Failsafe option

Our Hospital is being offered the option of running two MDIS SeriesX Unix
boxes with RealityX Pick implementations for our main patient records and
financials.

Does anyone have any experience with this addition to RealityX called
"Failsafe" as it seems to be a Data base controled mirroring and thus we
have grest concerns over its potential performance issues and its
reliability.

Any advice would be much appreciated

Many Thanks

James Thom
Nurse Informatician
The Royal Melbourne Hospital
Australia


2. DTC version

3. UK Human Resources Package needed MDIS RealityX

4. ODBC for CISAM

5. Calling C functions from RealityX

6. help ! : date, time, msaccess, not the best solution I guess...

7. please help - tcp/ip comms from realityx (pick) on sun unix

8. Convert YOur ULTimate Systems Now !!! (2)

9. Help: Seek command won't seek

10. Problem with Delphi3 CS and Sybase 11 - HELP please

11. Delphi CS 1.02 to Sybase Help

12. Help: source of CS-Library error 2/4/1/54 -cs_convert...The non-map replacemen

13. Help, please. CS major graduating in May