Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Error: Arguments are of the wrong type...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Error: Arguments are of the wrong type...

 Post Reply Post Reply
Author
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Topic: Error: Arguments are of the wrong type...
    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


Edited by ub3rl337ch3ch - 14 November 2005 at 10:01pm
Back to Top
Scott07 View Drop Down
Groupie
Groupie


Joined: 04 July 2002
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scott07 Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post 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.

Edited by theSCIENTIST - 27 November 2005 at 11:36am
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 27 November 2005 at 4:56pm
thats not it... claimno is an int field...
Confused
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post 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)

Edited by theSCIENTIST - 29 November 2005 at 3:37am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.