Getting started with Oracle: 2 problems



  • I need to access an Oracle database from a VB.Net application. I've managed to do it (after 3 days effort) without a problem on my development PC, talking to an Oracle XE database that I set up on a virtual PC (named daveserver2003) on the same PC. I installed the Instant Oracle drivers (instantclient-basic-win32-10.2.0.3-20061115) and ODBC drivers (instantclient-odbc-win32-10.2.0.3-20061115) into C:\Oracle, and ran the install app. I created environment variable TNS_ADMIN = C:\Oracle, and added C:\Oracle to the Path variable. And I created a tnsnames.ora file & put it in C:\Oracle. The contents of the file are:

    XE =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = daveserver2003)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XE)
        )
      )

    I created an ODBC data source, and tested it by importing a table from the Oracle database to a SQL Server database using the ODBC connection.

    In my VB.Net application I use System.data.oracleclient to do the database connection. This works perfectly on my development PC. When I deploy the app to any other PC, and follow exactly the same procedure to set up the drivers, I get the error “ORA-12154: TNS:could not resolve the connect identifier specified.” I am able to use the ODBC connection on these PC’s to connect e.g. MS Access to the database. It’s just my VB.Net app that can’t connect unless it is running on my development PC.

    (I have now also tried the System.Data.ODBC library & it also works fine on my debvelopment PC & nowhere else...)

    Any suggestion are greatly appreciated.

    My 2nd problem has to do with the Oracle drivers themselves: I set them up without any problems on several PC's, running WinXP and Win2003 with a variety of service packs. But I cannot get them to work on another set of PC's, with similar spec.s. On these, when I try to create an ODBC Data Source, as soon as I hit Finish, it says "The setup routines for the Oracle in instantclient10_2 ODBC driver could not be loaded due to system error code 126." and after that: "Could not load the setup or translator library". I swear I'm doing everything exactly the same on all the PC's.

     I have Googled for help for days, but no one can explain why it works on some PC's but not others.

    Any help here is also greatly appreciated.

    Dave

     

     



  • @DaveSemm said:

    I need to access an Oracle database from a VB.Net application. I've managed to do it (after 3 days effort) without a problem on my development PC, talking to an Oracle XE database that I set up on a virtual PC (named daveserver2003) on the same PC. I installed the Instant Oracle drivers (instantclient-basic-win32-10.2.0.3-20061115) and ODBC drivers (instantclient-odbc-win32-10.2.0.3-20061115) into C:\Oracle, and ran the install app. I created environment variable TNS_ADMIN = C:\Oracle, and added C:\Oracle to the Path variable. And I created a tnsnames.ora file & put it in C:\Oracle. The contents of the file are:

    XE =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = daveserver2003)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XE)
        )
      )

    I created an ODBC data source, and tested it by importing a table from the Oracle database to a SQL Server database using the ODBC connection.

    In my VB.Net application I use System.data.oracleclient to do the database connection. This works perfectly on my development PC. When I deploy the app to any other PC, and follow exactly the same procedure to set up the drivers, I get the error “ORA-12154: TNS:could not resolve the connect identifier specified.” I am able to use the ODBC connection on these PC’s to connect e.g. MS Access to the database. It’s just my VB.Net app that can’t connect unless it is running on my development PC.

    (I have now also tried the System.Data.ODBC library & it also works fine on my debvelopment PC & nowhere else...)

    Any suggestion are greatly appreciated.

    My 2nd problem has to do with the Oracle drivers themselves: I set them up without any problems on several PC's, running WinXP and Win2003 with a variety of service packs. But I cannot get them to work on another set of PC's, with similar spec.s. On these, when I try to create an ODBC Data Source, as soon as I hit Finish, it says "The setup routines for the Oracle in instantclient10_2 ODBC driver could not be loaded due to system error code 126." and after that: "Could not load the setup or translator library". I swear I'm doing everything exactly the same on all the PC's.

     I have Googled for help for days, but no one can explain why it works on some PC's but not others.

    Any help here is also greatly appreciated.

    1st problem: Check the tnsnames.ora on the other PC. The file tnsnames.ora is normally located at %ORACLE_HOME%\network\admin; e.g. \C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN on my machine.Place it there instead of tinkering with TNS_ADMIN.

    2nd problem: check this out 



  • Hi beanbag girl 4ever,

    Thanks for the fast reply.

    1st problem, I'm setting these all up to talk to the same server, using the same tnsnames.ora file on each & setting them up in the same folders on each PC. The instant oracle drivers get setup in a folder of your choice; I set it to C:\Oracle on every PC - there are no subfolders. I don't have any Oracle tools other then the instant drivers; (ok there are tools with Oracle XE, but since my development PC works fine, hopefully I shouldn't need to use any Oracle tools.) The VB.Net app can only talk to the database on my development PC; my guess is that there must be something .Net uses that is not in the Framework 1.1, and not with the Oracle drivers.

    2nd problem: I checked the registry settings on my development PC & one where I can't create the ODBC data source & all the settings are correct. I thought MDAC just had to do with SQLServer & MS Access - is it used with all ODBC connections? I'll look into this.

    Thanks again; hopefully we'll get this sorted out soon.

    Dave



  • Hi all,

    Problem 1 went away on its own after running a query about 30 times. Seems like it just needed time to find the server. Seems crazy.

    Problem 2: The Instant Client install files are missing two files: MFC71.dll and msvcrt.dll. These are commonly installed by other applications, so some PC’s will already have them while others don’t. I dont understand why so many people suggested updating MDAC.

    After working with MS SQL Server, I can't see how anyone would want to use Oracle.

    Cheers.

     



  • @DaveSemm said:

    After working with MS SQL Server, I can't see how anyone would want to use Oracle.

    You might want to join the IHOC, in case you haven't already done so.

    Anyway, Oracle can do a lot of things MS SQL Server can't. Like running on a unix box ;-) Oracle's PL/SQL is way better than T-SQL (important for people who write lots of stored procedures).
     



  • @ammoQ said:

    Anyway, Oracle can do a lot of things MS SQL Server can't. Like running on a unix box ;-)

    Or more importantly, running on thirty unix boxes. Clustering on MSSQL is a joke, and MS's excuse is that nobody wants to cluster SQL servers.
     



  • @DaveSemm said:

        (ADDRESS = (PROTOCOL = TCP)(HOST = daveserver2003)(PORT = 1521))

    Are you sure this is a driver problem and not a network configuration problem? From your post it's not clear where the VM is running. Is it on the dev PC only, or is it on the target PC as well? Are you trying to have the other machines connect to the VM? You'll have to configure additional network trickery to make your VM reachable from the outside world. Are the network interfaces configured correctly on the deployment pc? Is name resolution set up properly?

    Try this: start, run, cmd. telnet daveserver2003 1521

    Can you connect to the database server from the deployment PCs? 

     

    Edit: Never mind, missed the part where you mentioned the connection problem went away. 


     

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.