Connection from ASP Page to Oracle Fails

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Connection from ASP Page to Oracle Fails

    I am trying to connect to our corporate Oracle database to
    query some data in an ASP page. My experience with ASP has
    always been with SQL Server and Access databases, but I
    figured I could get a connection string to work. I tried
    using the following connection string:
    "Driver={Microsoft ODBC for
    Oracle};Server=PROD01;Uid=username;Pwd=password;"
    and got the following error:
    SQLAllocHandle on SQL_HANDLE_ENV failed

    I then set up an Oracle8 ODBC Driver connection and tried
    this:
    "DSN=ORDERS;Uid=username;Pwd=password;"
    and got this error:
    Specified driver could not be loaded due to system error
    126

    Finally, I set up an Access database, created 2 linked
    tables to my ODBC connection, tested them (I could open
    them fine within Access) and tried this string:
    "Provider=Microsoft.Jet.OLEDB.4.0; Data
    Source=C:\inetpub\wwwroot\aftweb\ORDERS_LINK.mdb" and got:
    Microsoft JET Database Engine (0x80004005)
    ODBC--connection to 'ORDERS' failed.
    (ORDERS is the ODBC connection to the Oracle database)

    Also tried this one:
    "Driver={Microsoft Access Driver
    (*.mdb)};Dbq=C:\inetpub\wwwroot\aftweb\ORDERS_LINK .mdb"
    and got the same error as above.

    Meanwhile, if I substitute an Access database which does
    not have linked tables into the same code, the connection
    works fine. So, any ideas? I have no access to the Oracle
    servers and no support from the Oracle DBAs, so patches to
    Oracle (which have been recommended before) are not an
    option.

    Thanks much for any help you can offer!
    Brian
    Brian Guest

  2. Similar Questions and Discussions

    1. #40331 [NEW]: 2nd MySQL connection fails with blank page (no error)
      From: splith at helper3000 dot net Operating system: Windows Server 2003 PHP version: 4.4.4 PHP Bug Type: MySQL related Bug...
    2. Access and Oracle connection on the same page. Strange Errors
      Greetings. I am trying to connect to both an oracle db and an access db. I know this is possible but my problem I think stems from the fact that...
    3. #24950 [Opn->Bgs]: Compiling PHP --with-oci8 --with oracle (Oracle 9i) fails
      ID: 24950 Updated by: sniper@php.net Reported By: fschulze at more-radio dot de -Status: Open +Status: ...
    4. #24950 [Com]: Compiling PHP --with-oci8 --with oracle (Oracle 9i) fails
      ID: 24950 Comment by: cunha17 at uol dot com dot br Reported By: fschulze at more-radio dot de Status: Feedback...
    5. #24950 [NEW]: Compiling PHP --with-oci8 --with oracle (Oracle 9i) fails
      From: fschulze at more-radio dot de Operating system: Solaris8 PHP version: 4.3.2 PHP Bug Type: Compile Failure Bug...
  3. #2

    Default Re: Connection from ASP Page to Oracle Fails

    On Mon, 29 Dec 2003 09:06:47 -0800, "Brian" <anonymous@discussions.microsoft.com> wrote:
    >I am trying to connect to our corporate Oracle database to
    >query some data in an ASP page. My experience with ASP has
    >always been with SQL Server and Access databases, but I
    >figured I could get a connection string to work. I tried
    >using the following connection string:
    >"Driver={Microsoft ODBC for
    >Oracle};Server=PROD01;Uid=username;Pwd=password ;"
    >and got the following error:
    >SQLAllocHandle on SQL_HANDLE_ENV failed
    >
    >I then set up an Oracle8 ODBC Driver connection and tried
    >this:
    >"DSN=ORDERS;Uid=username;Pwd=password;"
    >and got this error:
    >Specified driver could not be loaded due to system error
    >126
    >
    >Finally, I set up an Access database, created 2 linked
    >tables to my ODBC connection, tested them (I could open
    >them fine within Access) and tried this string:
    >"Provider=Microsoft.Jet.OLEDB.4.0; Data
    >Source=C:\inetpub\wwwroot\aftweb\ORDERS_LINK.md b" and got:
    >Microsoft JET Database Engine (0x80004005)
    >ODBC--connection to 'ORDERS' failed.
    >(ORDERS is the ODBC connection to the Oracle database)
    >
    >Also tried this one:
    >"Driver={Microsoft Access Driver
    >(*.mdb)};Dbq=C:\inetpub\wwwroot\aftweb\ORDERS_LIN K.mdb"
    >and got the same error as above.
    >
    >Meanwhile, if I substitute an Access database which does
    >not have linked tables into the same code, the connection
    >works fine. So, any ideas? I have no access to the Oracle
    >servers and no support from the Oracle DBAs, so patches to
    >Oracle (which have been recommended before) are not an
    >option.
    >
    >Thanks much for any help you can offer!
    >Brian
    1: Is an Oracle client installed on the web server? ( If not, read no further, you cannot connect to Oracle without one)

    2: Try using a dns-less connection like:
    myconn= Server.CreateObject("ADODB.Connection");
    myconn.ConnectionTimeout = 15;
    myconn.CommandTimeout = 30;

    myConnString="Provider=MSDAORA;Password=youroracle password;UserID=youroracleusernamet;DataSource=you rINSTANCE(tnsnames.ora
    alias);"
    myconn.ConnectionString=myConnString
    myconn.Open;

    This is more reliable and avoids many permissions issues involved in reading the DSN from the server.

    hth
    Turkbear Guest

  4. #3

    Default Re: Connection from ASP Page to Oracle Fails

    First try setting up a DSN to the oracle database and see if it works using
    the Oracle ODBC Test program. I suggest using the Microsoft driver rather
    than the Oracle driver although you may have success with the Oracle driver
    (we never have but it depends on the type of SQL statements and recordsets
    that you need).

    Once you have the connection working in ODBC Test try the same DSN
    connection in an ASP page. Here is what one of our connection strings look
    like:

    dsn=oracle-wbtman1ms;uid=<userid>;pwd=<password>

    If that does not work and it works in ODBC Test then there is probably a
    permission problem with the IUSR account.

    Once you have everything working through a DSN then you can try converting
    to a DSN-less connection.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    "Brian" <anonymous@discussions.microsoft.com> wrote in message
    news:05bc01c3ce2e$24a55ba0$a001280a@phx.gbl...
    > I am trying to connect to our corporate Oracle database to
    > query some data in an ASP page. My experience with ASP has
    > always been with SQL Server and Access databases, but I
    > figured I could get a connection string to work. I tried
    > using the following connection string:
    > "Driver={Microsoft ODBC for
    > Oracle};Server=PROD01;Uid=username;Pwd=password;"
    > and got the following error:
    > SQLAllocHandle on SQL_HANDLE_ENV failed
    >
    > I then set up an Oracle8 ODBC Driver connection and tried
    > this:
    > "DSN=ORDERS;Uid=username;Pwd=password;"
    > and got this error:
    > Specified driver could not be loaded due to system error
    > 126
    >
    > Finally, I set up an Access database, created 2 linked
    > tables to my ODBC connection, tested them (I could open
    > them fine within Access) and tried this string:
    > "Provider=Microsoft.Jet.OLEDB.4.0; Data
    > Source=C:\inetpub\wwwroot\aftweb\ORDERS_LINK.mdb" and got:
    > Microsoft JET Database Engine (0x80004005)
    > ODBC--connection to 'ORDERS' failed.
    > (ORDERS is the ODBC connection to the Oracle database)
    >
    > Also tried this one:
    > "Driver={Microsoft Access Driver
    > (*.mdb)};Dbq=C:\inetpub\wwwroot\aftweb\ORDERS_LINK .mdb"
    > and got the same error as above.
    >
    > Meanwhile, if I substitute an Access database which does
    > not have linked tables into the same code, the connection
    > works fine. So, any ideas? I have no access to the Oracle
    > servers and no support from the Oracle DBAs, so patches to
    > Oracle (which have been recommended before) are not an
    > option.
    >
    > Thanks much for any help you can offer!
    > Brian

    Mark Schupp Guest

  5. #4

    Default Re: Connection from ASP Page to Oracle Fails

    Mark,

    I do have a DSN set up. I am not aware of the "Oracle ODBC
    Test program", however I have successfully accessed the
    Oracle database through Access using the DSN I set up. I
    tried the Oracle8 ODBC driver and also the Microsoft ODBC
    driver for Oracle, and they both worked fine. So, I
    successfully set up an Access database with linked tables
    to Oracle, however I can't get the DSN to work with my ASP
    page, nor can I connect to the linked tables using the
    Access database I set up. Any ideas?

    Thanks,
    Brian
    >-----Original Message-----
    >First try setting up a DSN to the oracle database and see
    if it works using
    >the Oracle ODBC Test program. I suggest using the
    Microsoft driver rather
    >than the Oracle driver although you may have success with
    the Oracle driver
    >(we never have but it depends on the type of SQL
    statements and recordsets
    >that you need).
    >
    >Once you have the connection working in ODBC Test try the
    same DSN
    >connection in an ASP page. Here is what one of our
    connection strings look
    >like:
    >
    >dsn=oracle-wbtman1ms;uid=<userid>;pwd=<password>
    >
    >If that does not work and it works in ODBC Test then
    there is probably a
    >permission problem with the IUSR account.
    >
    >Once you have everything working through a DSN then you
    can try converting
    >to a DSN-less connection.
    >
    >--
    >Mark Schupp
    >Head of Development
    >Integrity eLearning
    >[url]www.ielearning.com[/url]
    >
    >
    >"Brian" <anonymous@discussions.microsoft.com> wrote in
    message
    >news:05bc01c3ce2e$24a55ba0$a001280a@phx.gbl...
    >> I am trying to connect to our corporate Oracle database
    to
    >> query some data in an ASP page. My experience with ASP
    has
    >> always been with SQL Server and Access databases, but I
    >> figured I could get a connection string to work. I tried
    >> using the following connection string:
    >> "Driver={Microsoft ODBC for
    >> Oracle};Server=PROD01;Uid=username;Pwd=password;"
    >> and got the following error:
    >> SQLAllocHandle on SQL_HANDLE_ENV failed
    >>
    >> I then set up an Oracle8 ODBC Driver connection and
    tried
    >> this:
    >> "DSN=ORDERS;Uid=username;Pwd=password;"
    >> and got this error:
    >> Specified driver could not be loaded due to system error
    >> 126
    >>
    >> Finally, I set up an Access database, created 2 linked
    >> tables to my ODBC connection, tested them (I could open
    >> them fine within Access) and tried this string:
    >> "Provider=Microsoft.Jet.OLEDB.4.0; Data
    >> Source=C:\inetpub\wwwroot\aftweb\ORDERS_LINK.mdb" and
    got:
    >> Microsoft JET Database Engine (0x80004005)
    >> ODBC--connection to 'ORDERS' failed.
    >> (ORDERS is the ODBC connection to the Oracle database)
    >>
    >> Also tried this one:
    >> "Driver={Microsoft Access Driver
    >> (*.mdb)};Dbq=C:\inetpub\wwwroot\aftweb\ORDERS_LINK .mdb"
    >> and got the same error as above.
    >>
    >> Meanwhile, if I substitute an Access database which does
    >> not have linked tables into the same code, the
    connection
    >> works fine. So, any ideas? I have no access to the
    Oracle
    >> servers and no support from the Oracle DBAs, so patches
    to
    >> Oracle (which have been recommended before) are not an
    >> option.
    >>
    >> Thanks much for any help you can offer!
    >> Brian
    >
    >
    >.
    >
    Guest

  6. #5

    Default Re: Connection from ASP Page to Oracle Fails

    I do not have an Oracle client installed on the web
    server, but my DSN works fine with Access. Any ideas on
    how I can get around the need for the client? I tried
    setting up an Access database with linked tables, which
    works fine, but I get errors connecting to it through my
    ASP page.

    Thanks again,
    Brian
    >-----Original Message-----
    >On Mon, 29 Dec 2003 09:06:47 -0800, "Brian"
    <anonymous@discussions.microsoft.com> wrote:
    >
    >>I am trying to connect to our corporate Oracle database
    to
    >>query some data in an ASP page. My experience with ASP
    has
    >>always been with SQL Server and Access databases, but I
    >>figured I could get a connection string to work. I tried
    >>using the following connection string:
    >>"Driver={Microsoft ODBC for
    >>Oracle};Server=PROD01;Uid=username;Pwd=password; "
    >>and got the following error:
    >>SQLAllocHandle on SQL_HANDLE_ENV failed
    >>
    >>I then set up an Oracle8 ODBC Driver connection and
    tried
    >>this:
    >>"DSN=ORDERS;Uid=username;Pwd=password;"
    >>and got this error:
    >>Specified driver could not be loaded due to system error
    >>126
    >>
    >>Finally, I set up an Access database, created 2 linked
    >>tables to my ODBC connection, tested them (I could open
    >>them fine within Access) and tried this string:
    >>"Provider=Microsoft.Jet.OLEDB.4.0; Data
    >>Source=C:\inetpub\wwwroot\aftweb\ORDERS_LINK.mdb " and
    got:
    >>Microsoft JET Database Engine (0x80004005)
    >>ODBC--connection to 'ORDERS' failed.
    >>(ORDERS is the ODBC connection to the Oracle database)
    >>
    >>Also tried this one:
    >>"Driver={Microsoft Access Driver
    >>(*.mdb)};Dbq=C:\inetpub\wwwroot\aftweb\ORDERS_LI NK.mdb"
    >>and got the same error as above.
    >>
    >>Meanwhile, if I substitute an Access database which does
    >>not have linked tables into the same code, the
    connection
    >>works fine. So, any ideas? I have no access to the
    Oracle
    >>servers and no support from the Oracle DBAs, so patches
    to
    >>Oracle (which have been recommended before) are not an
    >>option.
    >>
    >>Thanks much for any help you can offer!
    >>Brian
    >
    >1: Is an Oracle client installed on the web server? ( If
    not, read no further, you cannot connect to Oracle without
    one)
    >
    >2: Try using a dns-less connection like:
    > myconn= Server.CreateObject("ADODB.Connection");
    > myconn.ConnectionTimeout = 15;
    > myconn.CommandTimeout = 30;
    >
    >myConnString="Provider=MSDAORA;Password=youroracl epassword
    ;UserID=youroracleusernamet;DataSource=yourINSTANC E
    (tnsnames.ora
    >alias);"
    > myconn.ConnectionString=myConnString
    > myconn.Open;
    >
    >This is more reliable and avoids many permissions issues
    involved in reading the DSN from the server.
    >
    >hth
    >.
    >
    Brian Guest

  7. #6

    Default Re: Connection from ASP Page to Oracle Fails

    I assume the Access database is on a server that does have the Oracle client..The issue seems to be that you cannot pass
    the Oracle authentication to the Access database to use with its link to Oracle.
    Check the properties of the DSN ( or the link) on the Access machine and see if you can save the username/password
    combination so that it would not 'prompt' for it..Not sure it will work, however..

    Without an Oracle client ( to get SqlNet ) and absent Java ( which can use a thin-client connection) you will not be
    able to connect directly to any Oracle database, although there are some ODBC drivers from DirectConnect ( I think) that
    do not need an Oracle client ( they use something called Wire protocol - similar to Java's thin client).




    On Mon, 29 Dec 2003 10:05:48 -0800, "Brian" <anonymous@discussions.microsoft.com> wrote:
    >I do not have an Oracle client installed on the web
    >server, but my DSN works fine with Access. Any ideas on
    >how I can get around the need for the client? I tried
    >setting up an Access database with linked tables, which
    >works fine, but I get errors connecting to it through my
    >ASP page.
    >
    >Thanks again,
    >Brian
    >
    >>-----Original Message-----
    >>On Mon, 29 Dec 2003 09:06:47 -0800, "Brian"
    ><anonymous@discussions.microsoft.com> wrote:
    >>
    >>>I am trying to connect to our corporate Oracle database
    >to
    >>>query some data in an ASP page. My experience with ASP
    >has
    >>>always been with SQL Server and Access databases, but I
    >>>figured I could get a connection string to work. I tried
    >>>using the following connection string:
    >>>"Driver={Microsoft ODBC for
    >>>Oracle};Server=PROD01;Uid=username;Pwd=password ;"
    >>>and got the following error:
    >>>SQLAllocHandle on SQL_HANDLE_ENV failed
    >>>
    >>>I then set up an Oracle8 ODBC Driver connection and
    >tried
    >>>this:
    >>>"DSN=ORDERS;Uid=username;Pwd=password;"
    >>>and got this error:
    >>>Specified driver could not be loaded due to system error
    >>>126
    >>>
    >>>Finally, I set up an Access database, created 2 linked
    >>>tables to my ODBC connection, tested them (I could open
    >>>them fine within Access) and tried this string:
    >>>"Provider=Microsoft.Jet.OLEDB.4.0; Data
    >>>Source=C:\inetpub\wwwroot\aftweb\ORDERS_LINK.md b" and
    >got:
    >>>Microsoft JET Database Engine (0x80004005)
    >>>ODBC--connection to 'ORDERS' failed.
    >>>(ORDERS is the ODBC connection to the Oracle database)
    >>>
    >>>Also tried this one:
    >>>"Driver={Microsoft Access Driver
    >>>(*.mdb)};Dbq=C:\inetpub\wwwroot\aftweb\ORDERS_L INK.mdb"
    >>>and got the same error as above.
    >>>
    >>>Meanwhile, if I substitute an Access database which does
    >>>not have linked tables into the same code, the
    >connection
    >>>works fine. So, any ideas? I have no access to the
    >Oracle
    >>>servers and no support from the Oracle DBAs, so patches
    >to
    >>>Oracle (which have been recommended before) are not an
    >>>option.
    >>>
    >>>Thanks much for any help you can offer!
    >>>Brian
    >>
    >>1: Is an Oracle client installed on the web server? ( If
    >not, read no further, you cannot connect to Oracle without
    >one)
    >>
    >>2: Try using a dns-less connection like:
    >> myconn= Server.CreateObject("ADODB.Connection");
    >> myconn.ConnectionTimeout = 15;
    >> myconn.CommandTimeout = 30;
    >>
    >>myConnString="Provider=MSDAORA;Password=yourorac lepassword
    >;UserID=youroracleusernamet;DataSource=yourINSTAN CE
    >(tnsnames.ora
    >>alias);"
    >> myconn.ConnectionString=myConnString
    >> myconn.Open;
    >>
    >>This is more reliable and avoids many permissions issues
    >involved in reading the DSN from the server.
    >>
    >>hth
    >>.
    >>
    Turkbear Guest

  8. #7

    Default Re: Connection from ASP Page to Oracle Fails

    Oracle ODBC Test should have been installed with your oracle client software
    under "Network Administration" (that is where the Net8 configuration program
    is).

    I don't know what Access might be doing differently with a DSN connection
    but if it is working I would suspect a permission issue. Try setting the
    anonymous account for the web site temporarily to "Administrator", restart
    IIS, and see if that makes a difference.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    [url]www.ielearning.com[/url]


    <anonymous@discussions.microsoft.com> wrote in message
    news:018b01c3ce35$87234510$a101280a@phx.gbl...
    > Mark,
    >
    > I do have a DSN set up. I am not aware of the "Oracle ODBC
    > Test program", however I have successfully accessed the
    > Oracle database through Access using the DSN I set up. I
    > tried the Oracle8 ODBC driver and also the Microsoft ODBC
    > driver for Oracle, and they both worked fine. So, I
    > successfully set up an Access database with linked tables
    > to Oracle, however I can't get the DSN to work with my ASP
    > page, nor can I connect to the linked tables using the
    > Access database I set up. Any ideas?
    >
    > Thanks,
    > Brian
    >
    > >-----Original Message-----
    > >First try setting up a DSN to the oracle database and see
    > if it works using
    > >the Oracle ODBC Test program. I suggest using the
    > Microsoft driver rather
    > >than the Oracle driver although you may have success with
    > the Oracle driver
    > >(we never have but it depends on the type of SQL
    > statements and recordsets
    > >that you need).
    > >
    > >Once you have the connection working in ODBC Test try the
    > same DSN
    > >connection in an ASP page. Here is what one of our
    > connection strings look
    > >like:
    > >
    > >dsn=oracle-wbtman1ms;uid=<userid>;pwd=<password>
    > >
    > >If that does not work and it works in ODBC Test then
    > there is probably a
    > >permission problem with the IUSR account.
    > >
    > >Once you have everything working through a DSN then you
    > can try converting
    > >to a DSN-less connection.
    > >
    > >--
    > >Mark Schupp
    > >Head of Development
    > >Integrity eLearning
    > >[url]www.ielearning.com[/url]
    > >
    > >
    > >"Brian" <anonymous@discussions.microsoft.com> wrote in
    > message
    > >news:05bc01c3ce2e$24a55ba0$a001280a@phx.gbl...
    > >> I am trying to connect to our corporate Oracle database
    > to
    > >> query some data in an ASP page. My experience with ASP
    > has
    > >> always been with SQL Server and Access databases, but I
    > >> figured I could get a connection string to work. I tried
    > >> using the following connection string:
    > >> "Driver={Microsoft ODBC for
    > >> Oracle};Server=PROD01;Uid=username;Pwd=password;"
    > >> and got the following error:
    > >> SQLAllocHandle on SQL_HANDLE_ENV failed
    > >>
    > >> I then set up an Oracle8 ODBC Driver connection and
    > tried
    > >> this:
    > >> "DSN=ORDERS;Uid=username;Pwd=password;"
    > >> and got this error:
    > >> Specified driver could not be loaded due to system error
    > >> 126
    > >>
    > >> Finally, I set up an Access database, created 2 linked
    > >> tables to my ODBC connection, tested them (I could open
    > >> them fine within Access) and tried this string:
    > >> "Provider=Microsoft.Jet.OLEDB.4.0; Data
    > >> Source=C:\inetpub\wwwroot\aftweb\ORDERS_LINK.mdb" and
    > got:
    > >> Microsoft JET Database Engine (0x80004005)
    > >> ODBC--connection to 'ORDERS' failed.
    > >> (ORDERS is the ODBC connection to the Oracle database)
    > >>
    > >> Also tried this one:
    > >> "Driver={Microsoft Access Driver
    > >> (*.mdb)};Dbq=C:\inetpub\wwwroot\aftweb\ORDERS_LINK .mdb"
    > >> and got the same error as above.
    > >>
    > >> Meanwhile, if I substitute an Access database which does
    > >> not have linked tables into the same code, the
    > connection
    > >> works fine. So, any ideas? I have no access to the
    > Oracle
    > >> servers and no support from the Oracle DBAs, so patches
    > to
    > >> Oracle (which have been recommended before) are not an
    > >> option.
    > >>
    > >> Thanks much for any help you can offer!
    > >> Brian
    > >
    > >
    > >.
    > >

    Mark Schupp Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139