ADODB.recordset error (with MS Access, ASP.NET, adCmdStoredProc)

C

ching

Hi I've seen many posting in the web on the similar problem I
encountered below, but I still couldn't find any solution to it.

I built an ASP.NET application, which is migrated from ASP.

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.

has anyone got any idea what could be wrong? any help very much
appreciated.
 
B

Bob Barrows [MVP]

ching said:
Hi I've seen many posting in the web on the similar problem I
encountered below, but I still couldn't find any solution to it.

I built an ASP.NET application, which is migrated from ASP.

There was no way for you to know it, but this is a classic asp newsgroup.
While you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.aspnet.

But keep reading

the error message is :

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

This is a classic ADO error message, not a .Net message ...
it stopped at line:

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

???
I thought you were asking about ASP.Net. Why are you posting vbscript code
instead of VB>Net or C#?

I would suspect that objPagingConn does not contain either an open
Connection (recommended) or a connection string (not recommended).

before this line, I added db connect:

objPagingConn = CreateObject("ADODB.Connection")

In vbscript, when assigning an object (the connection object created by the
CreateObject function) to a variable, the Set keyword must be used:

Set objPagingConn = CreateObject("ADODB.Connection")

So my suspicion that objPagingConn is empty is confirmed. You could have
confirmed it yourself by doing:

Response.Write typename(objPagingConn)

<snip>

You should clarify whether you are creating a classic ASP application using
vbscript, or an ASP.Net application using one of the .Net languages.

Bob Barrows
 
C

ching

Sorry for the confusion.
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.
and to compile in VB.NET, I removed keywords SET.

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

thanks.
 
B

Bob Barrows [MVP]

ching said:
Sorry for the confusion.
The application was built using ASP initially. Recently we migrated to
ASP.NET, but we didn't recode the script using .NET.

Well, you needed to.
We just add the
aspcompat=true at each page directive.

Never heard of that...
and to compile in VB.NET, I removed keywords SET.

Takes more than that ...
My question here is why after sometime being idle the error happened
and not in the beginning?

No clue. You mean the code compiled and ran for some time and then all of a
sudden started raising the error? It's a mystery to me. Try the aspnet
group.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top