I’ve created 2 tables (MS Access XP) articles and authors.
Articles table has these fields (id, title, body, authorID) and Authors has (authorID and name). I linked between them by authored) I wanted to display first a list of all authors (authors.asp) then when you click on any other you can see a list of all articles belong to him/her (articles.asp).
authors.asp is working and this the code:
The problem is with articles.asp page. This is the code:
The error message I receive is: The specified field 'authorid' could refer to more than one table listed in the FROM clause of your SQL statement.
Any help?
Adel
Articles table has these fields (id, title, body, authorID) and Authors has (authorID and name). I linked between them by authored) I wanted to display first a list of all authors (authors.asp) then when you click on any other you can see a list of all articles belong to him/her (articles.asp).
authors.asp is working and this the code:
Code:
<%
selectnewsSQL="select * from authors"
set rsnews=ADO.execute(selectnewsSQL)
%>
<%
do while not rsnews.eof
%>
<a href="articles.asp?field=authors&authorid=<%=rsnews("authorid")%>"><%response.write rsnews("name")%></a>
<%
rsnews.movenext
loop
%>
<%
ADO.close
Set ADO=Nothing
%>
Code:
<%
authorid=request.querystring("authorid")
selectnewsSQL="select * from authors, articles where authorid=" & authorid
set rsnews=ADO.execute(selectnewsSQL)
%>
<%=rsnews("title")%>
<%=rsnews("name")%>
<%rsnews("body")")%>
<%
ADO.close
Set ADO=Nothing
%>
Any help?
Adel