What the - - - - is wrong with this "Inner Join"?

Results 1 to 2 of 2

Thread: What the - - - - is wrong with this "Inner Join"?

  1. #1
    Join Date
    Dec 1969

    Default What the - - - - is wrong with this "Inner Join"?

    I want to select rows from the table "base_tea" and join a row from the table "base_gen" where the field "base_gen.ID" matches "base_tea.sort". Base_gen.ID is autonumber.<BR><BR>I get this error message where I try to make the loop: "Item cannot be found in the collection corresponding to the requested name or ordinal." I have checked about 100 times that all the fields are mentioned in the SQL, so what&#039;s wrong? Heres the code:<BR><BR>Set AdoRs = adoCn.Execute("SELECT t.id, t.sort, t.txt1, g.id, g.txt1 FROM base_tea t INNER JOIN base_gen g ON t.sort = g.ID")<BR>Do Until AdoRs.EOF<BR>Response.Write"&#060;option value="&AdoRs("t.id")&"&#062;"&AdoRs("t.txt1")&""& AdoRs("g.txt1")&"&#060;/option&#062;"<BR>AdoRs.MoveNext<BR>Loop<BR>AdoRs.C lose<BR>Set AdoRs = Nothing<BR>Response.Write"&#060;/select&#062;"

  2. #2
    Join Date
    Dec 1969

    Default try this

    you are having an ADO problem.<BR>the name t.id in adoRS("t.id") is not found.<BR><BR>you can name your fields like this <BR>select t.txt as MyText1, g.txt as MyText2...<BR>then you can use adoRS("MyText1") <BR><BR>or use<BR><BR>Response.Write"&#060;option value="&AdoRs(0)&"&#062;"&AdoRs(2)&""&AdoRs("4")&" &#060;/option&#062;"<BR><BR>i think that might be the issue.<BR><BR><BR><BR><BR><BR><BR><BR>

Posting Permissions

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