?
Solved

connection string in VB6.0 to access Oracle Database remotely

Posted on 2006-05-25
6
Medium Priority
?
3,988 Views
Last Modified: 2008-10-03
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.



0
Comment
Question by:abu_alahsan
  • 2
3 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 16760173
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
 

Author Comment

by:abu_alahsan
ID: 16774704
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
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 2000 total points
ID: 16775237
you MUST have the Oracle Client installed.  That is an ABSOLUTE requirement.

AW
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month16 days, 9 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question