Hi,
Please find below my code. I am trying to achieve the following :
I am getting a set of records in a recordset object (oRSp).
I am using each of the recordset object value in "where clause of another select statement" to get one more recordset object (oRSv) . If I hard code the value in the where clause of second select statement, code works fine.
<HTML>
<HEAD>
<TITLE>Report</TITLE>
</HEAD><BODY>
<H1>Persons in Organization</h1>
<%
dim oRSv,conn,per,co
Set conn = Server.CreateObject("ADODB.Connection"
conn.open "DSN=sd4;userid=servicedesk;pwd=sd;"
set oRSv=server.CreateObject("ADODB.Recordset"
query = "select name_1 from v_organization;"
oRSv.open query, conn
oRSv.MoveFirst
Response.Write "<TABLE BORDER='1'>"
Do while NOT oRSv.EOF
Response.Write "<TR><TD>" & oRSv("name_1" & "</TD></TR>"
dim temp
temp = "'" &oRSv("name_1"&"';"
per = "select name from v_person where organization_name_1=" &temp
set oRSp=server.CreateObject("ADODB.Recordset"
oRSp.open per,conn
oRSp.MoveFirst
Do while NOT oRSp.EOF
Response.Write "<TR><TD>" & oRSp("name" & "</TD></TR>"
oRSp.moveNext
Loop
oRSv.MoveNext
Loop
Response.Write "</TABLE>"
oRSv.close
set oRSv=nothing
%></BODY></HTML>
When I run this code, it displays the following error
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/test.asp, line 22
Please suggest me where I am going wrong.
Any help on this would be really great..
Thanks in advance
Lakki
Please find below my code. I am trying to achieve the following :
I am getting a set of records in a recordset object (oRSp).
I am using each of the recordset object value in "where clause of another select statement" to get one more recordset object (oRSv) . If I hard code the value in the where clause of second select statement, code works fine.
<HTML>
<HEAD>
<TITLE>Report</TITLE>
</HEAD><BODY>
<H1>Persons in Organization</h1>
<%
dim oRSv,conn,per,co
Set conn = Server.CreateObject("ADODB.Connection"
conn.open "DSN=sd4;userid=servicedesk;pwd=sd;"
set oRSv=server.CreateObject("ADODB.Recordset"
query = "select name_1 from v_organization;"
oRSv.open query, conn
oRSv.MoveFirst
Response.Write "<TABLE BORDER='1'>"
Do while NOT oRSv.EOF
Response.Write "<TR><TD>" & oRSv("name_1" & "</TD></TR>"
dim temp
temp = "'" &oRSv("name_1"&"';"
per = "select name from v_person where organization_name_1=" &temp
set oRSp=server.CreateObject("ADODB.Recordset"
oRSp.open per,conn
oRSp.MoveFirst
Do while NOT oRSp.EOF
Response.Write "<TR><TD>" & oRSp("name" & "</TD></TR>"
oRSp.moveNext
Loop
oRSv.MoveNext
Loop
Response.Write "</TABLE>"
oRSv.close
set oRSv=nothing
%></BODY></HTML>
When I run this code, it displays the following error
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/test.asp, line 22
Please suggest me where I am going wrong.
Any help on this would be really great..
Thanks in advance
Lakki