473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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.

Sep 21 '05 #1
3 3660
ching wrote:
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
--
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"
Sep 21 '05 #2
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.

Bob Barrows [MVP] wrote:
ching wrote:
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
--
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"


Sep 22 '05 #3
ching wrote:
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.

--
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"
Sep 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Randi | last post by:
Hi all, I have this project to use the ADODB control to acces and manipulate the Access DB. I amd the mistake of first doing this project with just the data control. It worked fine with this...
1
by: Sandie Towers | last post by:
We use a number of similar databases and frequently create a new database using a backup restore of another similar database. We try to keep changes between databases in _Additional tables - like...
5
by: Simone | last post by:
Hello I hope you guys can help me. I am very new to ADO... I am creating a ADODB connection in a module and trying to access it from a command button in a form. Function fxEIDAssgn(plngEID As...
5
by: Tim Marshall | last post by:
I am trying to set a report's recordset property with an ADO recordset. I do the following and it works on a form. What do I need to do to do this correctly on a report? Private Sub...
5
by: dradcnn | last post by:
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...
3
by: Yuk Tang | last post by:
I'm trying to grab the fieldnames and values from a recordset, but I'm getting errors. I have an idea what the error might come from, but I'm not sure how to correct it. I'm connecting to an...
8
by: Ben | last post by:
Hi! I already sent this to the ACCESS newsgroup. But since I do not know really which side is really causing the problem, I have decided to send this inquiry to this newsgroup also, if I may....
1
by: sphinney | last post by:
All, I have a ADODB.Recordset in my Access 2002 project. I've been able to successfully add fields to the record set. According the the MS Access help files, I now must update the recordset to...
1
by: sanika1507 | last post by:
Hi .Actually I want to count the number of records in a recordset. So I m using the ADODB.Recordset. I just want some one to correct me. Set Cmd = Server.CreateObject("ADODB.Recordset") ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.