Arguments are of the wrong type

E

Erica

I'm getting the following error:

ADODB.Recordset error '800a0bb9'

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

/shop/results.asp, line 15

line 15 is the recordset open line. Can someone please help

if isnull(session("whois")) then
response.Redirect("../default.asp")
else
getCon=Application("connectionObject")
set objshop=server.CreateObject("adodb.recordset")
dim categoryid
categoryid = request.querystring("cat")
objshop.open "select * from tblproducts where catkey = " & categoryid &"
order by catkey",getcon,3,3
 
R

Ray Costanzo [MVP]

<%
categoryid = request.querystring("cat")
RESPONSE.WRITE "select * from tblproducts where catkey = " & categoryid &"
order by catkey"
RESPONSE.END
%>

Load that. Does your query look right? If so, open up tool for running
queries against your database and try running it. You didn't indicated what
database type you're using, so if this is SQL, use Query Analyzer. Access,
the query editor window, etc.

Ray at work
 
R

Ray Costanzo [MVP]

You verified that it is correct by copying and pasting that exact query and
running it in the Access query window?

Ray at home
 
E

Erica

Yes, and the query worked perfect. Here is what I copied and pasted

select * from tblproducts where catkey = 1 order by catkey
 
E

Erica

Ray,

First, thanks for your help. Second, 'getcon' is the connection object. The
strange thing is that this script worked fine and then all of sudden with no
warning it stopped working. I'm at a brick wall with this one. I've spent
almost 24 hours trying to figure this one ou t.
 
D

Des Perado

Erica said:
objshop.open "select * from tblproducts where catkey = " & categoryid &"

I don't understand the final bit: ... categoryid & "

Why append a double quote? Surely that's neither needed nor correct, and
results in three double quotes in the line. Remove the final &"
 
R

Ray Costanzo [MVP]

How did you deduce that her connection object is being stored in an app
variable? :]

Ray at work
 
R

Ray Costanzo [MVP]

What does your GEtCon function look like? -- Wait, sorry, I missed the
"getConn = Application("connectionObject")" line! I'm going to assume that
Application("connectionObject") is your connection string.

Try this code:

Dim oConn, objShop, sSQL
Dim categoryid
Dim sTest
sTest = Application("connectionObject")
RESPONSE.WRITE "CONNECTION STRING: " & STEST & "<HR>"


categoryid = Request.Querystring("cat")
RESPONSE.WRITE "CATEGORY ID: " & CATEGORYID & "<HR>"


sSQL = "select * from tblproducts where catkey = " & categoryid &" order by
catkey"
Set oConn = CreateObject("ADODB.Connection")
oConn.Open Application("connectionObject")
Set objShop = oConn.Execute(sSQL)
Response.Write "Records returned? " & (Not objShop.EOF)
objShop.Close : Set objShop = Nothing

Ray at work
 
B

Bob Lehmann

getCon=Application("connectionObject")

Bob Lehmann

Ray Costanzo said:
How did you deduce that her connection object is being stored in an app
variable? :]

Ray at work

thorpe said:
your storing your connection object in an application variable? bad
idea.
 
R

Ray Costanzo [MVP]

Notice that it's not _SET_ getCon =, so that would imply that
Application("connectionObject") is most likely a connection string, not a
connection object. It's just named a bit deceivingly.

Ray at work

Bob Lehmann said:
Bob Lehmann

Ray Costanzo said:
How did you deduce that her connection object is being stored in an app
variable? :]

Ray at work

thorpe said:
your storing your connection object in an application variable? bad
idea.
 
J

Jeff Dillon

Generally this means that you are using the ADO constants somewhere, but you
haven't Included adovbs.inc

Jeff
 
L

Larry Bud

Des Perado said:
I don't understand the final bit: ... categoryid & "

Why append a double quote? Surely that's neither needed nor correct, and
results in three double quotes in the line. Remove the final &"

I think it's the way the paste wrapped. Look at the next line.
 
L

Larry Bud

Erica said:
I'm getting the following error:

ADODB.Recordset error '800a0bb9'

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

/shop/results.asp, line 15

line 15 is the recordset open line. Can someone please help

if isnull(session("whois")) then
response.Redirect("../default.asp")
else
getCon=Application("connectionObject")
set objshop=server.CreateObject("adodb.recordset")
dim categoryid
categoryid = request.querystring("cat")
objshop.open "select * from tblproducts where catkey = " & categoryid &"
order by catkey",getcon,3,3

Are you sure categoryid is of a valid value?

Terrible idea to store a connection object in an application variable.
Are you sure that app var is valid?

If it used to work, how about permissions on the access file changing?
 

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,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top