Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle and ASP Error
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">City: </td> <td
<td class="label">Street: </td> <td class="value"> <select name="HouseID">
<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>")
</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
![]() |
![]() |