Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Arguments are of the wrong type, are out of acceptable range... etc

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-13-03, 19:54
pcollis pcollis is offline
Registered User
 
Join Date: Mar 2003
Posts: 5
Arguments are of the wrong type, are out of acceptable range... etc

I've got my connection setup and everything passes back and forth but when running this find command pulling from an access db I get the "wrong type, acceptabel range" error. Any ideas?

<%
Dim strConnect
%>
<!-- #include file="grantee_datastore.asp" -->
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<%
<%

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "2001", strConnect, adOpenStatic, adLockReadOnly, adCmdTable

While Not objRS.EOF ' now loop through the records
Response.Write "<b><a href='profile.asp?gID=" & objRS("ID") & "'>" & objRS("grantee name") & "</a></b><br>$" & objRS("grantee ammount") & "<br><br>"
objRS.MoveNext
Wend

objRS.Close ' now close and clean up
Set objRS = Nothing
%>
Reply With Quote
  #2 (permalink)  
Old 03-13-03, 19:55
pcollis pcollis is offline
Registered User
 
Join Date: Mar 2003
Posts: 5
p.s. it says the error is in the line:

objRS.Open "2001", strConnect, adOpenStatic, adLockReadOnly, adCmdTable
Reply With Quote
  #3 (permalink)  
Old 03-13-03, 21:35
rhs98 rhs98 is offline
Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 440
what is the exact error message and code?

Have you tried doing your rs stuff like this?

Code:
set list = Server.CreateObject("ADODB.Recordset") list.ActiveConnection = xx list.Source = query list.CursorType = 0 list.CursorLocation = 2 list.LockType = 3 list.Open()
Reply With Quote
  #4 (permalink)  
Old 03-13-03, 21:36
rhs98 rhs98 is offline
Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 440
at least if you change your code to work as above, the line number given by any errormessage will be more helpful
Reply With Quote
  #5 (permalink)  
Old 03-14-03, 14:16
pcollis pcollis is offline
Registered User
 
Join Date: Mar 2003
Posts: 5
Thanks for the tip mate.
I had a crack and managed to get past it (there was a problem with the meta tag). But now I'm stuck with a type mismatch error.

This is my first major crack at an .asp app and I'm sending a variable from one page to another via the usual ?ID=xxx method. Then asking it to pull the details of that ID from the db.

By the way, that ID is an autonumber primary key.

The problem now is it receives the number from one page to another but when I ask to pull the recordset it says "type mismatch" do I need to convert the string I passed into an integer for an autonumber primary key column? If so, how?
Reply With Quote
  #6 (permalink)  
Old 03-14-03, 22:25
rhs98 rhs98 is offline
Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 440
autonumbers are just numbers. You don't need to convert them; I suspect it is likely to be a problem with the way you are passing the variable between the pages; can you post the code?
Reply With Quote
  #7 (permalink)  
Old 03-17-03, 13:05
pcollis pcollis is offline
Registered User
 
Join Date: Mar 2003
Posts: 5
Smile

Quote:
Originally posted by rhs98
autonumbers are just numbers. You don't need to convert them; I suspect it is likely to be a problem with the way you are passing the variable between the pages; can you post the code?


Here's Page 1:

<%
Dim strConnect
%>
<!-- #include file="grantee_datastore.asp" -->
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<%

Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "2001", strConnect, adOpenStatic, adLockReadOnly, adCmdTable

While Not objRS.EOF ' now loop through the records
Response.Write "<b><a href='profile.asp?gID=" & objRS("ID") & "'>" & objRS("grantee name") & "</a></b><br>$" & objRS("grantee ammount") & "<br><br>"
objRS.MoveNext
Wend

objRS.Close ' now close and clean up
Set objRS = Nothing
%>


And Here's Page 2

<%
Dim strConnect
%>
<!-- #include file="grantee_datastore.asp" -->
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<%
Dim objRS, strCriteria, strID, strGName, strGAward, strGAmmount, strGDescription, strGWebsite, strGAddress, strGCountry, strGPicture
strID = Request.QueryString("ID")

Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "2001", strConnect, adOpenStatic, adLockReadOnly, adCmdTable

%>
<%
strCriteria = "ID='" & strID & "'"

objRS.Find strCriteria
If objRS.EOF Then
Response.Write "The database does not contain a profile for this entry <br><br><a href='index.asp'>Click here to return to the index</a>"
Else
Response.Write "<table cellpadding='0' cellspacing='0' border='0'><tr><td><br>" & _
"<img src='" & objRS("grantee picture") & "' border='0' alt='" & objRS("grantee name") & "'></td></tr></table><p>" & _
"<a href='>" & objRS("grantee link") & "<'>" & objRS("grantee name") & "</><br>" & _
objRS("grantee address") & "<br><br>" & objRS("grantee description")
End If
objRS.Close
Set objRS = Nothing
%>
Reply With Quote
  #8 (permalink)  
Old 03-17-03, 15:00
rhs98 rhs98 is offline
Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 440
Quote:
Dim objRS, strCriteria, strID, strGName, strGAward, strGAmmount, strGDescription, strGWebsite, strGAddress, strGCountry, strGPicture
strID = Request.QueryString("ID")

Quote:
While Not objRS.EOF ' now loop through the records
Response.Write "<b><a href='profile.asp?gID=" & objRS("ID") & "'>" & objRS("grantee name") & "</a></b><br>$" & objRS("grantee ammount") & "<br><br>"
objRS.MoveNext
Wend

you are passing a parameter as gID and then requesting it as ID. This is why it is broke!!!

Hope this was the problem

Last edited by rhs98 : 03-17-03 at 15:06.
Reply With Quote
  #9 (permalink)  
Old 03-17-03, 20:58
pcollis pcollis is offline
Registered User
 
Join Date: Mar 2003
Posts: 5
Hmm... good spot, and I thought that was it, but no...denied.

ADODB.Recordset error '800a0bb9'

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

/grantee/profile.asp, line 55


Line 55 was this by the way: objRS.Find strCriteria

Here was the whole file:

<%@LANGUAGE="VBSCRIPT"%>
<%
Dim strConnect
%>
<!-- #include file="grantee_datastore.asp" -->
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<%
'***************************************
'** SET NAVIGATION SETTINGS HERE *******
'***************************************

strTopNav = "Grantee"
strSubNav = "Profile"
strTertNav = ""

'***************************************
%>
<%
Dim objRS, strCriteria, strID, strGName, strGAward, strGAmmount, strGDescription, strGWebsite, strGAddress, strGCountry, strGPicture
strID = Request.QueryString("ID")

Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "2001", strConnect, adOpenStatic, adLockReadOnly, adCmdTable

%>
<!-- START MAIN CONTENT -->
<!-- #BeginTemplate "/Templates/common.dwt" -->

<!-- #BeginEditable "PageTitle" -->
<title>Skoll Foundation | Grantee List</title>
<!-- #EndEditable -->

<!-- #BeginEditable "PageDescription" -->
<meta name="description" content="Our">
<!-- #EndEditable -->

<!-- #BeginEditable "PageKeywords" -->
<meta name="keywords" content="Skoll">
<!-- #EndEditable -->

<!--#include virtual="common/beginsubpage.asp"-->

<!-- START MAIN CONTENT -->
<!-- #BeginEditable "MainContent" -->

<!--#include virtual="common/select_community.asp"-->

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><br>
<%
strCriteria = "ID='" & strID & "'"

objRS.Find strCriteria
If objRS.EOF Then
Response.Write "The database does not contain a profile for this entry <br><br><a href='index.asp'>Click here to return to the index</a>"
Else
Response.Write "<table cellpadding='0' cellspacing='0' border='0'><tr><td><br>" & _
"<img src='" & objRS("grantee picture") & "' border='0' alt='" & objRS("grantee name") & "'></td></tr></table><p>" & _
"<a href='>" & objRS("grantee link") & "<'>" & objRS("grantee name") & "</><br>" & _
objRS("grantee address") & "<br><br>" & objRS("grantee description")
End If
objRS.Close
Set objRS = Nothing
%>

</p>
<p>&nbsp; </p>
<br>
<br>
<!-- #EndEditable -->
<!-- END MAIN CONTENT -->

<!--#include virtual="common/endsubpage.asp"-->
<!-- #EndTemplate -->


By the way, doesn't anyone else help out here? Come on you lot, this poor lad's doin all the legwork. many thanks though... checked out your site by the way. funny stuff... I take it no one likes the gunners over there then? lol
Reply With Quote
  #10 (permalink)  
Old 03-18-03, 05:00
rhs98 rhs98 is offline
Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 440
well at least not my flatmates. You like my site??!??


Anyway, back to work~ it could be because I am allways on here, or they don't know about this or can't be bothered. Alot of people seem to come hear seeking the knowledge of a few...

Anyway, it is my job to help, being the moderator and all.

I haven't used the rs.find function before. I will have to have a look at it later in the day and post back what I find; I had a quick look and came up with these;

Don't think it's realvent but is interesting none the less.
http://www.macromedia.com/support/ul...r_800a0bb9.htm

http://dbforums.com/showthread.php?threadid=380582
and from the above thread;

http://support.microsoft.com/default...;en-us;Q197323
http://support.microsoft.com/default...;en-us;Q254517
http://support.microsoft.com/default...;en-us;Q235892


I haven't had much time to look at the above, but got it from http://www.google.com/search?hl=en&i...oo gle+Search
Reply With Quote
  #11 (permalink)  
Old 03-18-03, 07:32
rhs98 rhs98 is offline
Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 440
think the problem is your syntax- Change
Code:
strCriteria = "ID='" & strID & "'"
to this;
Code:
strCriteria = "ID=" & strID
According to this link, this is the syntax for numbers - they do not need to be (i.e. should not) be put in ' ' marks.

Hope this works!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On