error after up loading the site

S

Soha

After i upload the site i got an error on a page which was working on
the localhost.the error is
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Oracle][ODBC]Option value changed.

/arabic/adv_result.asp, line 244

this line is where i open the recordset. the connection to the database
is the same connection for the localhost and the hosting server.
this is the code i have problem in it:
<%'the connection to the orcale database server
set con=server.createobject("adodb.connection")
con.open "DSN=micn_db;UID=mic_news;PWD=micn;"

counts=0 'the variable which holds the numbers of records

s_text=request("text") 'the variable which holds the string i'm
searching for in the database

'the recordset in which i receive the data
set rs_search=server.createobject("adodb.recordset")

'i use this recordset to count the records i get
set rs_searchc=server.createobject("adodb.recordset")

'the sql statement i use
sql_search="select n_data.news_title, n_data.news_id,
n_data.news_date,n_source_lkp.source_desc from
mic_news.n_data,n_source_lkp where (n_source_lkp.source_desc like
'%"&s_text&"%') and n_data.area_id=1 and ((n_data.news_ref_date >=
'07/06/2005') or (n_data.news_ref_date <='21/07/2005')) and
n_source_lkp.source_id = n_data.source_id order by news_priority,
news_date; "

'here is wher i get the error in the opening of the recordset
rs_search.open sql_search,con,2,3

'to count the records i get from the previous sql statment
rs_searchc.open sql_search,con,1,3

'to display the data
if not rs_search.eof then
counts=counts+(rs_searchc.recordcount)
%>
<tr>
<%do until rs_search.eof%>
<tr>
<td><a
href="newscont.asp?n_id=<%=rs_search(1)%>"><%=rs_search(0)%></a>&nbsp;&nbsp;
</td>
</tr><tr>
<td><font size="2"
color="#C0C0C0"><%=rs_search(3)%>&nbsp;&nbsp;&nbsp;&nbsp;<%=rs_search(2)%>&nbsp;</font></td>
</tr>
<%
rs_search.movenext
loop
end if
rs_search.close
rs_searchc.close
%>

i want to know why did this code work on the localhost and it didn't
work on the hosting server.
Note: the database server is the same hosting server and i use it also
on the localhost. and all the other asp pages work fine on both
environment (localhost and the hosting server).
 
C

Curt_C [MVP]

Soha said:
After i upload the site i got an error on a page which was working on
the localhost.the error is
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Oracle][ODBC]Option value changed.

/arabic/adv_result.asp, line 244

80004005 is often a permissions issue. In this case the IIS user and the
createobject probably.
Look on www.aspfaq.com for the error #, you should get some decent stuff.
 
S

Soha

I have already look on www.aspfaq.com before i post this erorr. and i
have something to add to my code. this part of the sql_statment is
actually written in this way: "((n_data.news_ref_date >=
"'&request("from")&"') or (n_data.news_ref_date <='"&request("to")&"'))
"
"from" and "to" are textfields and they return type date.
and i think that they coz this problem but i don't know how to solve it.
 
B

Bob Barrows [MVP]

Soha said:
I have already look on www.aspfaq.com before i post this erorr. and i
have something to add to my code. this part of the sql_statment is
actually written in this way: "((n_data.news_ref_date >=
"'&request("from")&"') or (n_data.news_ref_date
<='"&request("to")&"')) "


Dynamic SQL ... ughh!
"from" and "to" are textfields and they return type date.
and i think that they coz this problem but i don't know how to solve
it.
Given that you are using this insecure* as well as inefficient technique,
these should help:
http://www.aspfaq.com/show.asp?id=2313 vbscript
http://www.aspfaq.com/show.asp?id=2040 help with dates
http://www.aspfaq.com/show.asp?id=2260 dd/mm/yyy confusion


Here's a better way:
http://groups-beta.google.com/group/microsoft.public.inetserver.asp.db/msg/b3d322b882a604bd

Even this is better:
http://groups-beta.google.com/group/microsoft.public.inetserver.asp.db/msg/72e36562fee7804e

Bob Barrows
*Here is why it is insecure:
http://mvp.unixwiz.net/techtips/sql-injection.html
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top