Connecting Tech Pros Worldwide Forums | Help | Site Map

error after up loading the site

Soha
Guest
 
Posts: n/a
#1: Jul 22 '05
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_s earch(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).


Curt_C [MVP]
Guest
 
Posts: n/a
#2: Jul 22 '05

re: error after up loading the site


Soha wrote:[color=blue]
> 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
>[/color]

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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Soha
Guest
 
Posts: n/a
#3: Jul 24 '05

re: error after up loading the site


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.

Bob Barrows [MVP]
Guest
 
Posts: n/a
#4: Jul 30 '05

re: error after up loading the site


Soha wrote:[color=blue]
> 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")&"')) "[/color]


Dynamic SQL ... ughh!
[color=blue]
> "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.[/color]
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/...d322b882a604bd

Even this is better:
http://groups-beta.google.com/group/...e36562fee7804e

Bob Barrows
*Here is why it is insecure:
http://mvp.unixwiz.net/techtips/sql-injection.html
http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Closed Thread