Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2003
    Posts
    5

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

  2. #2
    Join Date
    Mar 2003
    Posts
    5
    p.s. it says the error is in the line:

    objRS.Open "2001", strConnect, adOpenStatic, adLockReadOnly, adCmdTable

  3. #3
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    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()

  4. #4
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    at least if you change your code to work as above, the line number given by any errormessage will be more helpful

  5. #5
    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?

  6. #6
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    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?

  7. #7
    Join Date
    Mar 2003
    Posts
    5

    Smile

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

  8. #8
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    Dim objRS, strCriteria, strID, strGName, strGAward, strGAmmount, strGDescription, strGWebsite, strGAddress, strGCountry, strGPicture
    strID = Request.QueryString("ID")
    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.

  9. #9
    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

  10. #10
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    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...=Google+Search

  11. #11
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •