error after up loading the site

Discussion in 'ASP General' started by Soha, Jul 21, 2005.

  1. Soha

    Soha Guest

    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).
     
    Soha, Jul 21, 2005
    #1
    1. Advertising

  2. Soha

    Curt_C [MVP] Guest

    Soha wrote:
    > 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.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
     
    Curt_C [MVP], Jul 21, 2005
    #2
    1. Advertising

  3. Soha

    Soha Guest

    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.
     
    Soha, Jul 24, 2005
    #3
  4. Soha wrote:
    > 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
    --
    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"
     
    Bob Barrows [MVP], Jul 30, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UU5ndXllbg==?=

    Error loading webform after applying service packs

    =?Utf-8?B?UU5ndXllbg==?=, Oct 21, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    329
    =?Utf-8?B?UU5ndXllbg==?=
    Oct 21, 2004
  2. Neill
    Replies:
    30
    Views:
    1,508
    Neill
    Jun 15, 2004
  3. David Segall
    Replies:
    2
    Views:
    440
    Thomas Kellerer
    Jan 2, 2007
  4. Replies:
    4
    Views:
    311
  5. edfialk
    Replies:
    0
    Views:
    188
    edfialk
    May 10, 2007
Loading...

Share This Page