minority
08-31-2005, 02:04 AM
hey all.
ok i been trying to get this to work i can either get it not to work and dispaly nothing or it displays everything.
basically it does a search on department gets the dept name and then uses it for the field name to see if it has access to a relevent document type
<select name="DocType">
<%rsgeolink.open strSQL, strCon
Do until rsgeolink.EOF
deptname = rsgeolink("Dept_Name")
depttrue = "true"
strSQL2 = "SELECT * FROM Document_Type WHERE Doc_type_ID = "&Doctypeid&" AND ["&deptname&"] = "&depttrue&""
'response.write(rsgeolink2(""&deptname&""))
rsgeolink2.open strSQL2, strCon
if rsgeolink2("&deptname&") = "true" then
Response.Write("<option value=""" &deptname& """ > " &deptname& "</option>" & vbCrLf)
end if
rsgeolink2.close
rsgeolink.MoveNext()
loop
rsgeolink.close
%>
</select>
i am currently getting this error
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
on line 91 which is after i open sql2 (rsgeolink2.open strSQL2, strCon)
this line to be exact if rsgeolink2("&deptname&") = "true" then i dont know if it is the way i have tried to do the link to the database or what. but deptname can have spaces.
anyhelp would be great.
i know it poor practice but the field names have spaces inbetween words :(
so i put [] around them.
ok i been trying to get this to work i can either get it not to work and dispaly nothing or it displays everything.
basically it does a search on department gets the dept name and then uses it for the field name to see if it has access to a relevent document type
<select name="DocType">
<%rsgeolink.open strSQL, strCon
Do until rsgeolink.EOF
deptname = rsgeolink("Dept_Name")
depttrue = "true"
strSQL2 = "SELECT * FROM Document_Type WHERE Doc_type_ID = "&Doctypeid&" AND ["&deptname&"] = "&depttrue&""
'response.write(rsgeolink2(""&deptname&""))
rsgeolink2.open strSQL2, strCon
if rsgeolink2("&deptname&") = "true" then
Response.Write("<option value=""" &deptname& """ > " &deptname& "</option>" & vbCrLf)
end if
rsgeolink2.close
rsgeolink.MoveNext()
loop
rsgeolink.close
%>
</select>
i am currently getting this error
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
on line 91 which is after i open sql2 (rsgeolink2.open strSQL2, strCon)
this line to be exact if rsgeolink2("&deptname&") = "true" then i dont know if it is the way i have tried to do the link to the database or what. but deptname can have spaces.
anyhelp would be great.
i know it poor practice but the field names have spaces inbetween words :(
so i put [] around them.