Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Oracle and ASP Error

Oracle and ASP Error

From: Jay <jerry280_at_yahoo.com>
Date: Wed, 9 Apr 2003 10:07:08 -0500
Message-ID: <xGWka.8$Hg5.13910@news.uswest.net>


Hello everyone! I've created an ASP application to connect to an Oracle database. I used a file DSN but am now getting the following error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

ODBC driver does not support the requested properties.

This error message is for the following line of code: RS.open SQL, conn, 1, 2

Following is my ASP code. Can anyone help me figure out why I am getting the message? Also, is there a better way to connect to the Oracle database instead of a file DSN? I've heard arguments for DSN connections and DSN-Less connections with Oracle and am finding that the DSN connection isn't working so well.

<body>
<%
 Dim FormKey, ConStr, RS, SQL, conn
 For Each FormKey in Request.Form
 Session(FormKey) = Replace(Request.Form.Item (FormKey), "'", "''")  Next

 set conn=Server.CreateObject("ADODB.Connection")  conn.ConnectionTimeout=15
 conn.open "FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\Detective.dsn;" & _

 "uid=USERID;" & _
 "pwd=PASSWORD;" & _
 "server=ORACLESERVERNAME;"

 Set RS = Server.CreateObject("ADODB.RecordSet")  SQL = "SELECT HOUSE_KEY, STREET, LOT FROM VADDRESS_BASE WHERE" & _   "TRIM(BOTH ' ' FROM ADDR1) = '" & session.value("HouseNumber") & "' AND CITY" & _
  "= '" & UCASE(session.value("AddressCity")) & "' ORDER BY STREET, LOT;"  RS.open SQL, conn, 1, 2
 if not RS.eof then
%>

 <form action="dish2.asp" method="post">
 <input type="hidden" name="inc" value="2">
 <table border="0" summary="layout" align="center">
  <tr>
   <td class="label">House Number: </td>    <td class="value"><%=session.value("HouseNumber")%></td>   </tr>
  <tr>
   <td class="label">City:
   </td>
   <td

   class="value"><%=session.value("AddressCity")%></td>   </tr>
  <tr>
   <td class="label">Street:
   </td>
   <td class="value">
   <select name="HouseID">

<%
 do until RS.eof
%>

    <option value="<%=RS("HOUSE_KEY")%>"><%=RS("STREET")%>. <%=RS("LOT")%></option>
<%
 RS.movenext
 loop
%>

   </select>
<%
 else
  msg = session.value("HouseNumber") & " in " &   session.value("AddressCity") & " is not a recognized address."   session.abandon

  Response.Write("<" & "script>alert('" & msg & "');")
  Response.Write("location.href='dish.asp'")
  Response.Write("<" & "/script>")

  end if
  RS.close
  set RS = nothing
  conn.close
  set conn = nothing
%>

   </td>
  </tr>
  <tr>
   <td colspan="2" align="center"><input type="submit" name="submitBTN" value="Next -->"></td>
  </tr>
 </table>
</form>
</body>

Thank you!

J Received on Wed Apr 09 2003 - 10:07:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US