ADODB.recordset error (ASP/.NET)

Discussion in 'ASP .Net' started by dradcnn@yahoo.com.sg, Sep 22, 2005.

  1. Guest

    I built an ASP.NET application.The application was built using ASP
    initially. Recently we migrated to ASP.NET, but we didn't recode the
    script using .NET. We just add the aspcompat=true at each page
    directive.

    the error message is :

    Arguments are of the wrong type, are out of acceptable range, or are in
    conflict with one another.

    it stopped at line:

    objPagingRs.Open (strSQL, objPagingConn, 3, 1, 4)
    'adOpenStatic,adLockReadOnly,adCmdStoredProc

    before this line, I added db connect:

    objPagingConn = CreateObject("ADODB.Connection")
    objPagingConn.CursorLocation = 3 'adUseClient
    objPagingConn.ConnectionString = mstrConnectionString
    objPagingConn.Open

    strSQL = "Search_Result_Single #" & startDate & "#, #" &
    endDate & "#, '" & CityCode & "', " & breakfast & ", " & numberofstar
    & ", '" & HotelName & "'"

    the connection string is assigned to mstrConnectionString, which is
    defined in an include file as follows:

    mstrConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    & Server.MapPath("database/HP.mdb") & ";User ID=Admin;"

    when user starts my application from his browser, and he does a search
    on the page, the query will be sent to db, the results are returned to
    browser with a few pages; user may navigate between result pages, at
    this time, no error is generated.

    If the user leaves the web page idle for 20mins for more, and then he
    tries to navigate between the web pages (by clicking on customised next
    or previous button on the web page), above error will be generated.

    My question here is why after sometime being idle the error happened
    and not in the beginning?

    has anyone got any idea what could be wrong? any help very much
    appreciated.
    , Sep 22, 2005
    #1
    1. Advertising

  2. Are you making any use of session values? Where are these variables,
    startDate, endDate, CityCode, breakfast, numberofstar, and HotelName being
    defined? Can we see that code?

    Ray at home


    <> wrote in message
    news:...

    > Arguments are of the wrong type, are out of acceptable range, or are in
    > conflict with one another.
    >
    >
    > strSQL = "Search_Result_Single #" & startDate & "#, #" &
    > endDate & "#, '" & CityCode & "', " & breakfast & ", " & numberofstar
    > & ", '" & HotelName & "'"
    >
    > it stopped at line:
    >
    > objPagingRs.Open (strSQL, objPagingConn, 3, 1, 4)
    > 'adOpenStatic,adLockReadOnly,adCmdStoredProc
    >
    > when user starts my application from his browser, and he does a search
    > on the page, the query will be sent to db, the results are returned to
    > browser with a few pages; user may navigate between result pages, at
    > this time, no error is generated.
    >
    > If the user leaves the web page idle for 20mins for more, and then he
    > tries to navigate between the web pages (by clicking on customised next
    > or previous button on the web page), above error will be generated.
    Ray Costanzo [MVP], Sep 22, 2005
    #2
    1. Advertising

  3. Pat Guest

    I guess it would be worth it re writing it in ASP.NET
    And make use of the new ADONET
    Parick

    <> wrote in message
    news:...
    > I built an ASP.NET application.The application was built using ASP
    > initially. Recently we migrated to ASP.NET, but we didn't recode the
    > script using .NET. We just add the aspcompat=true at each page
    > directive.
    >
    > the error message is :
    >
    > Arguments are of the wrong type, are out of acceptable range, or are in
    > conflict with one another.
    >
    > it stopped at line:
    >
    > objPagingRs.Open (strSQL, objPagingConn, 3, 1, 4)
    > 'adOpenStatic,adLockReadOnly,adCmdStoredProc
    >
    > before this line, I added db connect:
    >
    > objPagingConn = CreateObject("ADODB.Connection")
    > objPagingConn.CursorLocation = 3 'adUseClient
    > objPagingConn.ConnectionString = mstrConnectionString
    > objPagingConn.Open
    >
    > strSQL = "Search_Result_Single #" & startDate & "#, #" &
    > endDate & "#, '" & CityCode & "', " & breakfast & ", " & numberofstar
    > & ", '" & HotelName & "'"
    >
    > the connection string is assigned to mstrConnectionString, which is
    > defined in an include file as follows:
    >
    > mstrConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    > & Server.MapPath("database/HP.mdb") & ";User ID=Admin;"
    >
    > when user starts my application from his browser, and he does a search
    > on the page, the query will be sent to db, the results are returned to
    > browser with a few pages; user may navigate between result pages, at
    > this time, no error is generated.
    >
    > If the user leaves the web page idle for 20mins for more, and then he
    > tries to navigate between the web pages (by clicking on customised next
    > or previous button on the web page), above error will be generated.
    >
    > My question here is why after sometime being idle the error happened
    > and not in the beginning?
    >
    > has anyone got any idea what could be wrong? any help very much
    > appreciated.
    >
    Pat, Sep 22, 2005
    #3
  4. ching Guest

    this is the code:

    startDate = Session("startDate")
    endDate = Session("endDate")
    CityCode = Session("CityCode")
    breakfast = cint(Session("Breakfast"))
    numberofstar= cint(Session("NumberOfStar"))
    hotelname = Session("HotelName")

    thanks.

    Ray Costanzo [MVP] wrote:

    > Are you making any use of session values? Where are these variables,
    > startDate, endDate, CityCode, breakfast, numberofstar, and HotelName being
    > defined? Can we see that code?
    >
    > Ray at home
    >
    >
    > <> wrote in message
    > news:...
    >
    > > Arguments are of the wrong type, are out of acceptable range, or are in
    > > conflict with one another.
    > >
    > >
    > > strSQL = "Search_Result_Single #" & startDate & "#, #" &
    > > endDate & "#, '" & CityCode & "', " & breakfast & ", " & numberofstar
    > > & ", '" & HotelName & "'"
    > >
    > > it stopped at line:
    > >
    > > objPagingRs.Open (strSQL, objPagingConn, 3, 1, 4)
    > > 'adOpenStatic,adLockReadOnly,adCmdStoredProc
    > >
    > > when user starts my application from his browser, and he does a search
    > > on the page, the query will be sent to db, the results are returned to
    > > browser with a few pages; user may navigate between result pages, at
    > > this time, no error is generated.
    > >
    > > If the user leaves the web page idle for 20mins for more, and then he
    > > tries to navigate between the web pages (by clicking on customised next
    > > or previous button on the web page), above error will be generated.
    ching, Sep 22, 2005
    #4
  5. Paul Clement Guest

    On 21 Sep 2005 19:56:26 -0700, wrote:

    ¤ I built an ASP.NET application.The application was built using ASP
    ¤ initially. Recently we migrated to ASP.NET, but we didn't recode the
    ¤ script using .NET. We just add the aspcompat=true at each page
    ¤ directive.
    ¤
    ¤ the error message is :
    ¤
    ¤ Arguments are of the wrong type, are out of acceptable range, or are in
    ¤ conflict with one another.
    ¤
    ¤ it stopped at line:
    ¤
    ¤ objPagingRs.Open (strSQL, objPagingConn, 3, 1, 4)
    ¤ 'adOpenStatic,adLockReadOnly,adCmdStoredProc
    ¤

    I believe the last parameter should be ADODB.CommandTypeEnum.adCmdText and not adCmdStoredProc. The
    parameter may also be omitted altogether since you're using a SQL string.

    I would recommend using the enums instead of numeric literals in your Open statement.


    Paul
    ~~~~
    Microsoft MVP (Visual Basic)
    Paul Clement, Sep 22, 2005
    #5
  6. That would be the problem then. The session times out after 20 minutes (the
    default setting), so those variables get no value.

    Ray at home

    "ching" <> wrote in message
    news:...
    > this is the code:
    >
    > startDate = Session("startDate")
    > endDate = Session("endDate")
    > CityCode = Session("CityCode")
    > breakfast = cint(Session("Breakfast"))
    > numberofstar= cint(Session("NumberOfStar"))
    > hotelname = Session("HotelName")
    >
    > thanks.
    >
    > Ray Costanzo [MVP] wrote:
    >
    >> Are you making any use of session values? Where are these variables,
    >> startDate, endDate, CityCode, breakfast, numberofstar, and HotelName
    >> being
    >> defined? Can we see that code?
    >>
    >> Ray at home
    >>
    >>
    >> <> wrote in message
    >> news:...
    >>
    >> > Arguments are of the wrong type, are out of acceptable range, or are in
    >> > conflict with one another.
    >> >
    >> >
    >> > strSQL = "Search_Result_Single #" & startDate & "#, #" &
    >> > endDate & "#, '" & CityCode & "', " & breakfast & ", " & numberofstar
    >> > & ", '" & HotelName & "'"
    >> >
    >> > it stopped at line:
    >> >
    >> > objPagingRs.Open (strSQL, objPagingConn, 3, 1, 4)
    >> > 'adOpenStatic,adLockReadOnly,adCmdStoredProc
    >> >
    >> > when user starts my application from his browser, and he does a search
    >> > on the page, the query will be sent to db, the results are returned to
    >> > browser with a few pages; user may navigate between result pages, at
    >> > this time, no error is generated.
    >> >
    >> > If the user leaves the web page idle for 20mins for more, and then he
    >> > tries to navigate between the web pages (by clicking on customised next
    >> > or previous button on the web page), above error will be generated.

    >
    Ray Costanzo [MVP], Sep 22, 2005
    #6
    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. Tom Petersen

    Connection error: ADODB.Recordset (0x800A0E7D)

    Tom Petersen, Sep 16, 2003, in forum: ASP General
    Replies:
    2
    Views:
    212
    Tom Petersen
    Sep 16, 2003
  2. Chuck
    Replies:
    1
    Views:
    117
    Ray at
    Oct 21, 2003
  3. Drew
    Replies:
    8
    Views:
    265
    Jeff Dillon
    Nov 5, 2004
  4. ching
    Replies:
    3
    Views:
    272
    Bob Barrows [MVP]
    Sep 22, 2005
  5. avcitamer
    Replies:
    6
    Views:
    206
    Bob Barrows [MVP]
    Sep 18, 2008
Loading...

Share This Page