Deploy Application with Oracle Client 9.2

Hello

I have written an application with VC++ 6.0, I use OCI interface of Oracle Client to connect to Oracle server. Now i want to deploy my application to others clients. These Clients must install Oracle Client, or can we create a pakage that contain needed "dll" of Oracle Client (if we can do that, how can we replace some definitions in TNSName of Oracle Client)

thanks advance.
blueadminAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

schwertnerCommented:
Because you use OCI i think you have to install Oracle client on every site which contains the needed DLLs
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
earth man2Commented:
You can install required dlls in application directory.  You need to set environment variable TNS_ADMIN to point to where tnsnames.ora file will be kept eg application directory.

tnsnames.ora is just a text file.  Create one using sql*net configuration tool and use it as a template.  You might also need sqlnet.ora to handle all those exotic SQL*Net options.
0
earth man2Commented:
/* here is an example using ODBC */
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <sqltypes.h>
#include <stdlib.h>
#include <stdio.h>

#define MAXCOLS 5
#define COL1_LEN 80

int main ( int argc, char *argv[] )
{
HENV  m_henv;
HDBC  m_hdbc;
HSTMT m_hstmt;

SQLCHAR query[] = "SELECT COL1 FROM TEST";
SQLCHAR szConnStrOut[255];
SQLCHAR col1val[COL1_LEN];
SQLCHAR m_connect[] = "DRIVER={Microsoft ODBC for Oracle};CONNECTSTRING=TESTDSNLESS.WORLD;UID=URusername;PWD=URpassword";

SQLINTEGER  col1_len;
SQLSMALLINT pcbConnStrOut;
RETCODE     ret;

char tns_string[] = "TESTDSNLESS.WORLD =\n\
  (DESCRIPTION =\n\
    (ADDRESS_LIST =\n\
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))\n\
    )\n\
    (CONNECT_DATA =\n\
      (SERVICE_NAME = orcl.world)\n\
    )\n\
  )\n";

char buf[_MAX_PATH],tns_admin_str[_MAX_PATH + 11];
FILE *tnsnames = fopen( "tnsnames.ora", "w" );

  fputs( tns_string, tnsnames );
  fclose( tnsnames );
  sprintf( tns_admin_str, "TNS_ADMIN=\"%s\"", _getcwd( buf, _MAX_PATH - 1 ) );
  _putenv( tns_admin_str );
  SQLAllocEnv( &m_henv );
  ret = SQLAllocConnect( m_henv, &m_hdbc );
  ret = SQLDriverConnect( m_hdbc, (SQLHWND) NULL, m_connect, SQL_NTS, szConnStrOut, 255, &pcbConnStrOut, SQL_DRIVER_COMPLETE );
  if ( ret == SQL_SUCCESS ) {
    SQLAllocStmt( m_hdbc, &m_hstmt );
    ret = SQLExecDirect( m_hstmt, query, SQL_NTS );
    if ( ( ret == SQL_SUCCESS ) || ( ret == SQL_SUCCESS_WITH_INFO ) ) {
      printf( "ODBC Connect Success with %s\n", szConnStrOut );
      SQLBindCol( m_hstmt, 1, SQL_C_CHAR, col1val, COL1_LEN, &col1_len );
      while ( TRUE ) {
        ret = SQLFetch( m_hstmt );
        if (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO){
          printf("%s\n", col1val );
        } else {
          break;
        }
      }
    }
  }
 SQLDisconnect( m_hdbc );

  return 0;
}
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

earth man2Commented:
This is a copy of all the oracle libraries loaded when I ran an OCI program.

'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oci.dll', No symbols loaded.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oraclient9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORACORE9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORANLS9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORAUNLS9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oravsn9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oracommon9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\orageneric9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORAXML9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORAXSD9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\orannzsbb9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oran9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oranl9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oranldap9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oraldapclnt9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\orancrypt9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oratrace9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oranro9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oranhost9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oranoname9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORANCDS9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\orantns9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oranms.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\oranmsp.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORAPLS9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORASLAX9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORASNLS9.DLL', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\orawtc9.dll', Cannot find or open a required DBG file.
'ocite.exe': Loaded 'F:\Oracle\ora92\bin\ORASQL9.DLL', Cannot find or open a required DBG file.
0
blueadminAuthor Commented:
Ok
I have copy your code(modify paramenter in tnsnames.ora) and build test.exe.
I have build a pakage (setup .msi inlcudes test.exe and all dlls that you had showed me).

I install to another client, it's unsucess.

please help me
thanks in advance.
0
earth man2Commented:
Well,  what fails, an error message might be helpful.
0
blueadminAuthor Commented:
Sorry for my late.

ok, it appear

          "Oracle client and networking component was not found. These components are
          suppled by Oracle and are part of the Oracle Version 7.3.3 or later client software
           installation.
           Provider is unable to function until these components are installed"

thanks in advance.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.