ADODB.recordset error (ASP/.NET)

D

dradcnn

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.
 
R

Ray Costanzo [MVP]

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
 
P

Pat

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

ching

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.
 
P

Paul Clement

On 21 Sep 2005 19:56:26 -0700, (e-mail address removed) 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)
 
R

Ray Costanzo [MVP]

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
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top