For Programmers: Free Programming Magazines  


Home > Archive > ASP > October 2004 > Arguments are of the wrong type









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Arguments are of the wrong type
Erica

2004-10-26, 8:55 pm

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
Ray Costanzo [MVP]

2004-10-26, 8:55 pm


<%
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



"Erica" <Erica@discussions.microsoft.com> wrote in message
news:342FA7DD-1C95-44B3-8870-997B8973A430@microsoft.com...
> 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



Erica

2004-10-27, 3:55 am

The sql statement is correct. I am using Access database.

"Ray Costanzo [MVP]" wrote:

>
> <%
> 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
>
>
>
> "Erica" <Erica@discussions.microsoft.com> wrote in message
> news:342FA7DD-1C95-44B3-8870-997B8973A430@microsoft.com...
>
>
>

Ray Costanzo [MVP]

2004-10-27, 3:55 am

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

Ray at home

"Erica" <Erica@discussions.microsoft.com> wrote in message
news:9F2E2568-FFF4-40B9-8D8E-1E6FF8E58910@microsoft.com...[color=darkred]
> The sql statement is correct. I am using Access database.
>
> "Ray Costanzo [MVP]" wrote:
>


Erica

2004-10-27, 3:55 am

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

select * from tblproducts where catkey = 1 order by catkey



"Ray Costanzo [MVP]" wrote:

> You verified that it is correct by copying and pasting that exact query and
> running it in the Access query window?
>
> Ray at home
>
> "Erica" <Erica@discussions.microsoft.com> wrote in message
> news:9F2E2568-FFF4-40B9-8D8E-1E6FF8E58910@microsoft.com...
>
>
>

Ray Costanzo [MVP]

2004-10-27, 3:55 am

Alright, what is "getcon" then? Can you post that function?

Ray at home

"Erica" <Erica@discussions.microsoft.com> wrote in message
news:4772136E-64EF-4D13-9305-DBAE13EFCBCC@microsoft.com...[color=darkred]
> Yes, and the query worked perfect. Here is what I copied and pasted
>
> select * from tblproducts where catkey = 1 order by catkey
>
>
>
> "Ray Costanzo [MVP]" wrote:
>


Erica

2004-10-27, 3:55 am

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.

"Ray Costanzo [MVP]" wrote:

> Alright, what is "getcon" then? Can you post that function?
>
> Ray at home
>
> "Erica" <Erica@discussions.microsoft.com> wrote in message
> news:4772136E-64EF-4D13-9305-DBAE13EFCBCC@microsoft.com...
>
>
>

Des Perado

2004-10-27, 8:55 am


"Erica" <Erica@discussions.microsoft.com> wrote in message
news:342FA7DD-1C95-44B3-8870-997B8973A430@microsoft.com...
> 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 &"



thorpe

2004-10-27, 8:55 am

your storing your connection object in an application variable? bad idea.

"Erica" <Erica@discussions.microsoft.com> wrote in message
news:3139948D-040A-4058-9C02-D38387C2C2CF@microsoft.com...
> 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[color=darkred]
> 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.
>
> "Ray Costanzo [MVP]" wrote:
>
query[color=darkred]
are[color=darkred]


Ray Costanzo [MVP]

2004-10-27, 3:55 pm

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

Ray at work

"thorpe" <temp@tpg.com.au> wrote in message
news:O7uMqcBvEHA.1988@TK2MSFTNGP12.phx.gbl...
> your storing your connection object in an application variable? bad idea.



Ray Costanzo [MVP]

2004-10-27, 3:55 pm

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







"Erica" <Erica@discussions.microsoft.com> wrote in message
news:3139948D-040A-4058-9C02-D38387C2C2CF@microsoft.com...[color=darkred]
> 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.
>
> "Ray Costanzo [MVP]" wrote:
>


Bob Lehmann

2004-10-27, 3:55 pm

>> getCon=Application("connectionObject")

Bob Lehmann

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:#OWp0nCvEHA.612@TK2MSFTNGP15.phx.gbl...
> How did you deduce that her connection object is being stored in an app
> variable? :]
>
> Ray at work
>
> "thorpe" <temp@tpg.com.au> wrote in message
> news:O7uMqcBvEHA.1988@TK2MSFTNGP12.phx.gbl...
idea.[color=darkred]
>
>



Ray Costanzo [MVP]

2004-10-27, 3:55 pm

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" <none> wrote in message
news:e7I951CvEHA.3492@TK2MSFTNGP10.phx.gbl...
>
> Bob Lehmann
>
> "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
> message news:#OWp0nCvEHA.612@TK2MSFTNGP15.phx.gbl...
> idea.
>
>



Jeff Dillon

2004-10-27, 3:55 pm

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

Jeff

"Erica" <Erica@discussions.microsoft.com> wrote in message
news:342FA7DD-1C95-44B3-8870-997B8973A430@microsoft.com...
> 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



Larry Bud

2004-10-27, 3:55 pm

"Des Perado" <des@per.ado> wrote in message news:<2u928cF286bb1U1@uni-berlin.de>...
> "Erica" <Erica@discussions.microsoft.com> wrote in message
> news:342FA7DD-1C95-44B3-8870-997B8973A430@microsoft.com...
>
> 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.
Larry Bud

2004-10-27, 3:55 pm

"Erica" <Erica@discussions.microsoft.com> wrote in message news:<342FA7DD-1C95-44B3-8870-997B8973A430@microsoft.com>...
> 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?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com