connection string in VB6.0 to access Oracle Database remotely

Hi,

I am trying to build an app for my client in which I want to access Oracle Database hosted somewhere else. I don't want my client to install any oracle client software.

YES, if any components can be included with installer then it's fine.
I have tried the following connection string I succeeded

strCon = "Provider=MSDASQL;" & _
          "Driver={Microsoft ODBC for Oracle}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
        "(HOST=66.201.121.6)(PORT=1521))" & _
         "(CONNECT_DATA=(SERVICE_NAME=TXS))); uid=abc;pwd=xyz;"

BUT oracle client is installed on my PC. when I run this app on any other PC which is just installed with Windows 2003/XP etc, It does not work

and following error occue

the oracle (TM) client and network components were not found.

Can u help me.



abu_alahsanAsked:
Who is Participating?
 
Arthur_WoodConnect With a Mentor Commented:
you MUST have the Oracle Client installed.  That is an ABSOLUTE requirement.

AW
0
 
Arthur_WoodCommented:
first off, this connection string:

strCon = "Provider=MSDASQL;" & _
          "Driver={Microsoft ODBC for Oracle}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
        "(HOST=66.201.121.6)(PORT=1521))" & _
         "(CONNECT_DATA=(SERVICE_NAME=TXS))); uid=abc;pwd=xyz;"

is using the MSDASQL provider (which the SQL Server Provider) but attempting to connection to an ORACLE database.  That is problem #1

Try this change (uses the MSDAORA data provider from Microsoft - the ORACLE Data Provider):

strCon = "Provider=MSDAORA;" & _
          "Driver={Microsoft ODBC for Oracle}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
        "(HOST=66.201.121.6)(PORT=1521))" & _
         "(CONNECT_DATA=(SERVICE_NAME=TXS))); uid=abc;pwd=xyz;"

AW
0
 
abu_alahsanAuthor Commented:
I have tried the above solution

strCon = "Provider=MSDAORA;" & _
          "Driver={Microsoft ODBC for Oracle}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
        "(HOST=66.201.121.6)(PORT=1521))" & _
         "(CONNECT_DATA=(SERVICE_NAME=TXS))); uid=abc;pwd=xyz;"

and found error "ORA 12560: TNS: Protocol Error"

IF I just try
strCon = "Driver={Microsoft ODBC for Oracle}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
        "(HOST=66.201.121.6)(PORT=1521))" & _
         "(CONNECT_DATA=(SERVICE_NAME=TXS))); uid=abc;pwd=xyz;"

it works But again on PC installed with Oracle Client Software

How to by pass it or install it through VB Package


0
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.

All Courses

From novice to tech pro — start learning today.