Print Page | Close Window

Error: Arguments are of the wrong type...

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=17257
Printed Date: 29 March 2026 at 11:03pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Error: Arguments are of the wrong type...
Posted By: ub3rl337ch3ch
Subject: Error: Arguments are of the wrong type...
Date Posted: 14 November 2005 at 10:00pm
using sql server, asp, ie6
 
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
 
this happens on the vrec.open line below. it happens consistently, not sporadically.
 
sql = "SELECT transno FROM ClaimTrans WHERE claimno =" & claimno vrec.open sql, adoCon
 
i have used the same connection and recordset before, both without trouble (well, this kind of trouble at least) - they're both set in a common ssi, which is used in all of my pages (about a dozen or so).  I've also used them both dozens and dozens of times without a hitch. I even have a select on the same page (which works) that is *exactly* the same bar that it selects a few more fields:
 
sql = "SELECT fieldname, croptype, area, transno FROM ClaimTrans WHERE claimNo=" & claimno
vrec.open sql, adoCon
 
transno is a unique key field with an identity seed, which my boss suggested might be the issue, but i tried selecting 'area' - float - and 'fieldname' - nvarchar - in transno's place, with the same error
 
puleeaaase someone point out the (probably) simple problem that is causing this... Ouch



Replies:
Posted By: Scott07
Date Posted: 25 November 2005 at 3:33pm
might be an idea to open the DB and get the varible out on the page so you can see what it is first (incase its trying to return an object) then stick it on the end (providing its returning what your expecting) with clng(whatever) round it to make sure its in the correct type (other ones to try are cint and cdbl)

-------------
http://www.worldsofwar.co.uk - Worlds of War II


Posted By: theSCIENTIST
Date Posted: 27 November 2005 at 11:32am
I suspect your DB column only accepts integers, and you may be injecting strings.

Also observe;

This:
"... claimNo=" & claimno & ""

Is the same as this:
"... claimNo=23"

To inject strings, one would use this:
"... claimNo='" & claimno & "'"

Note the [ '" & strName & "' ] to inject strings and integers, opposed to the [ " & IntNumber & " ] to inject integers only.

If this is not your problem, send me more info about it.

-------------
:: http://www.mylittlehost.com/ - www.mylittlehost.com


Posted By: ub3rl337ch3ch
Date Posted: 27 November 2005 at 4:56pm
thats not it... claimno is an int field...
Confused


Posted By: theSCIENTIST
Date Posted: 29 November 2005 at 1:08am
Try:

vrec.open sql, adoCon, 2

Or

vrec.open sql, adoCon, 3

Or

Set vrec = adoCon.Execute(sql)

-------------
:: http://www.mylittlehost.com/ - www.mylittlehost.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net