Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2007
    Posts
    21

    Question Unanswered: [SOLVED]Complex Fields index

    i'll just put the Code first, and ask my question later.

    Code:
    Dim AuthID 
    AuthID = Topic.Fields.Item("Autnm").Value
    .
    .
    .
    <%=(Author_Names_From_ID.Fields(AuthID).Item("Author_Hebrew").Value)%>
    Autnm is numbers, 1-20.
    AuthID is suposed to take this number.
    Than it should print from Author_Hebrew in field AuthID

    but it says:
    Error Type:
    ADODB.Recordset (0x800A0CC1)
    Item cannot be found in the collection corresponding to the requested name or ordinal.


    Seems it points wrong on the field... any idea?

    if u need the whole code its just 100 lines... well i'll post it here any ways:
    Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="28598"%>
    <!--#include file="Connections/KerenDB.asp" -->
    <%
    Dim Topic__MMColParam
    Topic__MMColParam = "1"
    If (Request.QueryString("Topic") <> "") Then 
      Topic__MMColParam = Request.QueryString("Topic")
    End If
    %>
    <%
    Dim Topic
    Dim Topic_numRows
    
    Set Topic = Server.CreateObject("ADODB.Recordset")
    Topic.ActiveConnection = MM_KerenDB_STRING
    Topic.Source = "SELECT Bknm_Hebrew, Bknm_English, Autnm, Note, ISBN, Pages, Size, Cover, Topic, PUSD, PNIS, PEUR, PLS, Lang FROM Library,Author WHERE Topic = '" + Replace(Topic__MMColParam, "'", "''") + "' ORDER BY Bknm_Hebrew ASC"
    Topic.CursorType = 0
    Topic.CursorLocation = 2
    Topic.LockType = 1
    Topic.Open()
    
    Topic_numRows = 0
    %>
    <%
    Dim Autnm_hebrew
    Dim Autnm_English
    Autnm_ID = Topic.Fields.Item("Autnm").Value
    %>
    <%
    Dim Author_Names_From_ID
    Dim Author_Names_From_ID_numRows
    
    Set Author_Names_From_ID = Server.CreateObject("ADODB.Recordset")
    Author_Names_From_ID.ActiveConnection = MM_KerenDB_STRING
    Author_Names_From_ID.Source = "SELECT ID, Author_English, Author_hebrew FROM Author ORDER BY ID ASC"
    Author_Names_From_ID.CursorType = 0
    Author_Names_From_ID.CursorLocation = 2
    Author_Names_From_ID.LockType = 1
    Author_Names_From_ID.Open()
    
    Author_Names_From_ID_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index
    
    Repeat1__numRows = 10
    Repeat1__index = 0
    Topic_numRows = Topic_numRows + Repeat1__numRows
    %>
    <%
    Dim Repeat2__numRows
    Dim Repeat2__index
    
    Repeat2__numRows = -1
    Repeat2__index = 0
    Topic_numRows = Topic_numRows + Repeat2__numRows
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;" />
    <title>Keren Ahvah Meshihit</title>
    <link href="css.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <table border="1" cellpadding="1" cellspacing="1">
      <% While ((Repeat1__numRows <> 0) AND (NOT Topic.EOF)) %>
        <%
    	Dim AuthID 
    	AuthID = Topic.Fields.Item("Autnm").Value
    	%>
    	<tr>
          <td rowspan="3">image</td>
          <td colspan="3"><h3>
            <%=(Topic.Fields.Item("Bknm_Hebrew").Value)%><br />
          <%=(Author_Names_From_ID.Fields(AuthID).Item("Author_Hebrew").Value)%></td>
        </tr>
        <tr>
          <td colspan="3"><h4>
            <%=(Topic.Fields.Item("Bknm_English").Value)%><br />
            <%=AuthID%>
    		<%=(Author_Names_From_ID.Fields(AuthID).Item("Author_English").Value)%></td>
    
        </tr>
        <tr>
          <td colspan="3"><h5>
            <%=(Topic.Fields.Item("Note").Value)%></td>
        </tr>
        <tr>
          <td><h6>
            <%=(Topic.Fields.Item("Topic").Value)%></td>
          <td><h6>
            <%=(Topic.Fields.Item("Pages").Value)%></td>
          <td><h6>
            <%=(Topic.Fields.Item("ISBN").Value)%></td>
          <td><h6>
            <%=(Topic.Fields.Item("PUSD").Value)%></td>
        </tr>
        <% 
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      Topic.MoveNext()
    Wend
    %>
    </table>
    </body>
    </html>
    <%
    Topic.Close()
    Set Topic = Nothing
    %>
    <%
    Author_Names_From_ID.Close()
    Set Author_Names_From_ID = Nothing
    %>
    Last edited by noamsmadja; 12-27-07 at 09:41. Reason: Problem solved

  2. #2
    Join Date
    Dec 2007
    Posts
    21

    Problem Solved

    I managed to do it else ways

    Thanks anyways!!

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Well done... What was the solution?
    George
    Home | Blog

  4. #4
    Join Date
    Dec 2007
    Posts
    21

    Relationship mistake

    i did a wrongrelationship, relating text to number types. After fixing it in the db it worked. Eventualy ot is to complex to relate a text field... Am i right? Could someone enlighten us plz.
    Thx in advance!!!

  5. #5
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    re

    Quote Originally Posted by noamsmadja
    i did a wrongrelationship, relating text to number types. After fixing it in the db it worked. Eventualy ot is to complex to relate a text field... Am i right? Could someone enlighten us plz.
    Thx in advance!!!
    Youll have to do a cast of the type if your wanna make a link from Text to number

    with numbers you do a JOIN and it compares 1 with 1
    with text you do a JOIN and it compares "ABC" with "ABC"

    if you want text to compare with numbers you cant do
    JOIN to compare "ABC" with 1 (gives a type mismatch)
    with a cast you can fool it to do a JOIN on "ABC" with "1"

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I suggest you just make them the same datatype (and size/limit) instead of casting/converting on your joins!
    George
    Home | Blog

  7. #7
    Join Date
    Dec 2007
    Posts
    21
    its solved already... no more posts... thx!!

Posting Permissions

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