1

I have an error in the following sql.

    (SELECT shorthand, display, larry_ranking, site_url
FROM larrydb_site_list lsl JOIN larrydb_review lr on
lsl.sid = lr.sid 
WHERE display=true AND niche='regular' 
ORDER BY larry_ranking DESC Limit 2)


UNION


(SELECT shorthand, display, larry_ranking, site_url
FROM larrydb_site_list lsl JOIN larrydb_review lr on
lsl.sid = lr.sid 
WHERE display=true AND niche='regular' AND shorthand='sexier')

I put it into one line:

    dim rsFav
sSQL = "(SELECT shorthand, display, larry_ranking, site_url FROM larrydb_site_list lsl JOIN larrydb_review lr on lsl.sid = lr.sid WHERE display=true AND niche='regular' ORDER BY larry_ranking DESC Limit 2) UNION (SELECT shorthand, display, larry_ranking, site_url FROM larrydb_site_list lsl JOIN larrydb_review lr on lsl.sid = lr.sid WHERE display=true AND niche='regular' AND shorthand='sexier')"
Set rsFav = objConn.Execute(sSQL)

I get this error..

ADODB.Recordset error '800a0cc1' Item cannot be found in the collection corresponding to the requested name or ordinal.

/sandbox/inc_fav_sites.asp, line 29

I think the problem is in the sql string....not in the asp code..cause I didnt touch it

This line 29 <a href="http://livecamdeals.com/review.asp?sitename=<%=LCase(rsFav(""))%>"></a>

Sorry, I dont know asp programming but sql..

1 Answer 1

4

Your problem is that, in ASP, you are asking the RecordSet (i.e. the results back from SQL) for a column called "" (empty-string).

Obviously, you're SQL does not return such a column!!

The fix is to change the ASP code to select the correct column. E.g. to select the site_url column :

LCase(rsFav("site_url")
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks , Awesome, It has helped

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.