tasneem
05-09-2005, 05:57 PM
Hi
I have a msaccess db, with relational tables like
tblmastercategory, tblcategory, tblmastersku etc. Both tblmastercategory and tblcategory are related to tblmastersku, but not to each other.
I have the asp page for tblmastercategory with links to open tblcategory for that mastercategory. This is something like this:(line breaks for readability)
tblmastersku has
mastercategoryid
categoryid
otherfields
tblmastercategory has
mastercategoryid
mastercategoryname
tblcategory has
categoryid
categoryname
I have put the link in tblmastercategory like this:
<%
dim strsql
DIM qrycats 'to pass value to categories.asp page.
'then more asp code to open the recordset.
' then below is the link
<a href="categories.asp?qrycats=<%= rsmaincats("MasterCategoryID") %>">
<% response.Write (rsmaincats.Fields("MasterCategoryName").Value) %></a>
This is working till now, it passes the query to qrycats in the next page of categories.asp where I have this code:
<%
DIM qrycats 'value passed from mastercategories.asp
dim strsql 'sql query
strsql = "SELECT DISTINCTROW tblCategoryNames.CategoryID,
tblCategoryNames.CategoryName,
tblMasterCategoryNames.MasterCategoryID,
tblMasterSKU.MasterCategoryID FROM tblMasterCategoryNames
INNER JOIN (tblCategoryNames INNER JOIN tblMasterSKU ON
tblCategoryNames.CategoryID = tblMasterSKU.CategoryID) ON
tblMasterCategoryNames.MasterCategoryID =
tblMasterSKU.MasterCategoryID
WHERE tblMasterSKU.MasterCategoryID= '"& qrycats &"' ;"
This gives me this error:
ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
/miscprojects/midtownofficesupplies/catsprods/categories.asp,
line number
Can someone help me here?
thanks
I have a msaccess db, with relational tables like
tblmastercategory, tblcategory, tblmastersku etc. Both tblmastercategory and tblcategory are related to tblmastersku, but not to each other.
I have the asp page for tblmastercategory with links to open tblcategory for that mastercategory. This is something like this:(line breaks for readability)
tblmastersku has
mastercategoryid
categoryid
otherfields
tblmastercategory has
mastercategoryid
mastercategoryname
tblcategory has
categoryid
categoryname
I have put the link in tblmastercategory like this:
<%
dim strsql
DIM qrycats 'to pass value to categories.asp page.
'then more asp code to open the recordset.
' then below is the link
<a href="categories.asp?qrycats=<%= rsmaincats("MasterCategoryID") %>">
<% response.Write (rsmaincats.Fields("MasterCategoryName").Value) %></a>
This is working till now, it passes the query to qrycats in the next page of categories.asp where I have this code:
<%
DIM qrycats 'value passed from mastercategories.asp
dim strsql 'sql query
strsql = "SELECT DISTINCTROW tblCategoryNames.CategoryID,
tblCategoryNames.CategoryName,
tblMasterCategoryNames.MasterCategoryID,
tblMasterSKU.MasterCategoryID FROM tblMasterCategoryNames
INNER JOIN (tblCategoryNames INNER JOIN tblMasterSKU ON
tblCategoryNames.CategoryID = tblMasterSKU.CategoryID) ON
tblMasterCategoryNames.MasterCategoryID =
tblMasterSKU.MasterCategoryID
WHERE tblMasterSKU.MasterCategoryID= '"& qrycats &"' ;"
This gives me this error:
ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
/miscprojects/midtownofficesupplies/catsprods/categories.asp,
line number
Can someone help me here?
thanks