Item cannot be found in the collection corresponding to the reques

Item cannot be found in the collection corresponding to the reques

am 17.03.2005 23:29:04 von jack

Hi, I am trying to run a sample code to see how it works. However, I am
getting the following error message:
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name
or ordinal.
/gwis/FSR_EditDetail_test2.asp, line 346

THE CODE:
if mypage="Exp" then
sql01 = "SELECT ExpenditureTbl.* FROM ExpenditureTbl "
sql01 = sql01 & "WHERE ExpenditureTbl.GrantID = " & GrantID
end if

if mypage = "Inc" then
sql01 = "SELECT IncomeTbl.* FROM IncomeTbl "
sql01 = sql01 & "WHERE IncomeTbl.GrantID = " & GrantID
end if

if mypage = "Forf" then
sql01 = "SELECT ForfeitureTbl.* FROM ForfeitureTbl "
sql01 = sql01 & "WHERE ForfeitureTbl.GrantID = " & GrantID
end if
'write out the detail information from the database for Exp, Inc or Forf.

'response.write "Sue SQL:" & sql01
rstemp1.Open sql01
'set rstemp=conntemp.execute(sql01)
Do until rstemp1.eof
i = i + 1
response.write "" & vbCRLF

if MyPage="Exp" then
strLink = "" & vbCRLF
end if

if MyPage="Inc" then
strLink = "" & vbCRLF
end if

if MyPage="Forf" then
strLink = "" & vbCRLF
end if

response.write strLink & vbCRLF
if session("locked")<>"Y" then
if MyPage="Exp" Then
strLink = " HREF='ConfirmDeleteExpLine.asp?ExpenditureID=" & rstemp("ExpenditureID") &
"&PageType="&mypage&"&Max="&max&"'>Delete
" & vbCRLF
end if

if MyPage="Inc" then
strLink = " HREF='ConfirmDeleteExpLine.asp?ExpenditureID=" & rstemp("IncomeID") &
"&PageType="&mypage&"&Max="&max&"'>Delete
" & vbCRLF
end if

if MyPage="Forf" then
strLink = " HREF='ConfirmDeleteExpLine.asp?ExpenditureID=" & rstemp("ForfeitureID") &
"&PageType="&mypage&"&Max="&max&"'>Delete
" & vbCRLF
end if

response.write strLink & vbCRLF
else
strLink = "" & vbCRLF
response.write strLink & vbCRLF
end if

If rstemp1("ClaimNo") = "" then
strLink = " TYPE='text' SIZE=6 NAME='ClaimNo_"& i & "' VALUE='" & rstemp("ClaimNo") &
"'>" & vbCRLF
else
strLink = " NAME='ClaimNo_"& i & "' VALUE='" & rstemp("ClaimNo") & "'>" & vbCRLF
end if

response.write strLink & vbCRLF

strLink = " NAME='Expmonth_" & i & "'VALUE='" & month(rstemp("ExpDate")) & "'>/ TYPE='text' SIZE=1 NAME='ExpDay_" & i & "'VALUE='" & day(rstemp("ExpDate")) &
"'>/ " & vbCRLF


'continue to write out the detail line

response.write strLink & vbCRLF

strLink = " NAME='PaidTo_" & i & "' VALUE='" & rstemp("WhomPaid") & "'>" & vbCRLF
response.write strLink & vbCRLF
strLink = "" &
formatcurrency(rstemp("Amount")) & "" & vbCRLF
response.write strLink & vbCRLF
strLink = " NAME='Personnel_" & i & "' VALUE='" & rstemp("Personnel") & "'
style='text-align: right;'>" & vbCRLF
response.write strLink & vbCRLF
strLink = " NAME='ContServ_" & i & "' VALUE='" & rstemp("ContServ") & "'
style='text-align: right;'>" & vbCRLF
response.write strLink & vbCRLF
strLink = " NAME='Travel_" & i & "' VALUE='" & rstemp("Travel") & "' style='text-align:
right;'>" & vbCRLF
response.write strLink & vbCRLF
strLink = " NAME='Equipment_" & i & "' VALUE='" & rstemp("Equipment") & "'
style='text-align: right;'>" & vbCRLF
response.write strLink & vbCRLF
strLink = " NAME='OperExp_" & i & "' VALUE='" & rstemp("OperExp") & "' style='text-align:
right;'>" & vbCRLF
response.write strLink & vbCRLF
response.write "" & vbCRLF
rstemp1.movenext
loop
rstemp1.Close
%>

The error is in the following line:
strLink = "" & vbCRLF

I could not figure out why the error is happening. Any help is appreciated
in advance.

Re: Item cannot be found in the collection corresponding to the reques

am 17.03.2005 23:53:18 von Steven Burn

http://aspfaq.com/show.asp?id=3D2275

--=20
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Jack" wrote in message =
news:39F772AF-A09D-4467-9C89-33B87D5BB32B@microsoft.com...
> Hi, I am trying to run a sample code to see how it works. However, I =
am=20
> getting the following error message:
> Error Type:
> ADODB.Recordset (0x800A0CC1)
> Item cannot be found in the collection corresponding to the requested =
name=20
> or ordinal.
> /gwis/FSR_EditDetail_test2.asp, line 346
>=20
> THE CODE:
> if mypage=3D"Exp" then
> sql01 =3D "SELECT ExpenditureTbl.* FROM ExpenditureTbl "
> sql01 =3D sql01 & "WHERE ExpenditureTbl.GrantID =3D " & GrantID
> end if
>=20
> if mypage =3D "Inc" then
> sql01 =3D "SELECT IncomeTbl.* FROM IncomeTbl "
> sql01 =3D sql01 & "WHERE IncomeTbl.GrantID =3D " & GrantID
> end if
>=20
> if mypage =3D "Forf" then
> sql01 =3D "SELECT ForfeitureTbl.* FROM ForfeitureTbl "
> sql01 =3D sql01 & "WHERE ForfeitureTbl.GrantID =3D " & GrantID
> end if
> 'write out the detail information from the database for Exp, Inc or =
Forf.
>=20
> 'response.write "Sue SQL:" & sql01
> rstemp1.Open sql01
> 'set rstemp=3Dconntemp.execute(sql01)
> Do until rstemp1.eof
> i =3D i + 1
> response.write "" & vbCRLF
>=20
> if MyPage=3D"Exp" then
> strLink =3D " NAME=3D'ExpenditureID_" &=20
> i & "' VALUE=3D" & rstemp("ExpenditureID") & ">" & vbCRLF
> end if
>=20
> if MyPage=3D"Inc" then
> strLink =3D " NAME=3D'ExpenditureID_" &=20
> i & "' VALUE=3D" & rstemp("IncomeID") & ">" & vbCRLF
> end if
>=20
> if MyPage=3D"Forf" then
> strLink =3D " NAME=3D'ExpenditureID_" &=20
> i & "' VALUE=3D" & rstemp("ForfeitureID") & ">" & vbCRLF
> end if
>=20
> response.write strLink & vbCRLF
> if session("locked")<>"Y" then
> if MyPage=3D"Exp" Then
> strLink =3D " > HREF=3D'ConfirmDeleteExpLine.asp?ExpenditureID=3D" & =
rstemp("ExpenditureID") &=20
> "&PageType=3D"&mypage&"&Max=3D"&max&"'>Delete
" & vbCRLF
> end if
>=20
> if MyPage=3D"Inc" then
> strLink =3D " > HREF=3D'ConfirmDeleteExpLine.asp?ExpenditureID=3D" & =
rstemp("IncomeID") &=20
> "&PageType=3D"&mypage&"&Max=3D"&max&"'>Delete
" & vbCRLF
> end if
>=20
> if MyPage=3D"Forf" then
> strLink =3D " > HREF=3D'ConfirmDeleteExpLine.asp?ExpenditureID=3D" & =
rstemp("ForfeitureID") &=20
> "&PageType=3D"&mypage&"&Max=3D"&max&"'>Delete
" & vbCRLF
> end if
>=20
> response.write strLink & vbCRLF
> else
> strLink =3D "" & vbCRLF
> response.write strLink & vbCRLF
> end if
>=20
> If rstemp1("ClaimNo") =3D "" then
> strLink =3D "
> TYPE=3D'text' SIZE=3D6 NAME=3D'ClaimNo_"& i & "' VALUE=3D'" & =
rstemp("ClaimNo") &=20
> "'>" & vbCRLF=20
> else
> strLink =3D " SIZE=3D6 =20
> NAME=3D'ClaimNo_"& i & "' VALUE=3D'" & rstemp("ClaimNo") & "'>" & =
vbCRLF=20
> end if
>=20
> response.write strLink & vbCRLF
>=20
> strLink =3D " SIZE=3D1=20
> NAME=3D'Expmonth_" & i & "'VALUE=3D'" & month(rstemp("ExpDate")) & =
"'>/ > TYPE=3D'text' SIZE=3D1 NAME=3D'ExpDay_" & i & "'VALUE=3D'" & =
day(rstemp("ExpDate")) &=20
> "'>/ "'VALUE=3D'" &=20
> year(rstemp("ExpDate")) & "'>" & vbCRLF
>=20
>=20
> 'continue to write out the detail line=20
>=20
> response.write strLink & vbCRLF
>=20
> strLink =3D " SIZE=3D20=20
> NAME=3D'PaidTo_" & i & "' VALUE=3D'" & rstemp("WhomPaid") & "'>" =
& vbCRLF
> response.write strLink & vbCRLF
> strLink =3D "" & =20
> formatcurrency(rstemp("Amount")) & "" & vbCRLF
> response.write strLink & vbCRLF
> strLink =3D " SIZE=3D12=20
> NAME=3D'Personnel_" & i & "' VALUE=3D'" & rstemp("Personnel") & "'=20
> style=3D'text-align: right;'>" & vbCRLF
> response.write strLink & vbCRLF
> strLink =3D " SIZE=3D12=20
> NAME=3D'ContServ_" & i & "' VALUE=3D'" & rstemp("ContServ") & "'=20
> style=3D'text-align: right;'>" & vbCRLF
> response.write strLink & vbCRLF =20
> strLink =3D " SIZE=3D12=20
> NAME=3D'Travel_" & i & "' VALUE=3D'" & rstemp("Travel") & "' =
style=3D'text-align:=20
> right;'>" & vbCRLF
> response.write strLink & vbCRLF
> strLink =3D " SIZE=3D12=20
> NAME=3D'Equipment_" & i & "' VALUE=3D'" & rstemp("Equipment") & "'=20
> style=3D'text-align: right;'>" & vbCRLF
> response.write strLink & vbCRLF
> strLink =3D " SIZE=3D12=20
> NAME=3D'OperExp_" & i & "' VALUE=3D'" & rstemp("OperExp") & "' =
style=3D'text-align:=20
> right;'>" & vbCRLF
> response.write strLink & vbCRLF
> response.write "" & vbCRLF
> rstemp1.movenext
> loop
> rstemp1.Close
> %>
>=20
> The error is in the following line:
> strLink =3D " NAME=3D'ExpenditureID_" & i &=20
> "' VALUE=3D" & rstemp("ExpenditureID") & ">" & vbCRLF
>=20
> I could not figure out why the error is happening. Any help is =
appreciated=20
> in advance.

Re: Item cannot be found in the collection corresponding to the re

am 18.03.2005 00:07:01 von jack

Thanks Steven for the help. I will follow the link. Regards.

"Steven Burn" wrote:

> http://aspfaq.com/show.asp?id=2275
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> www.it-mate.co.uk
>
> Keeping it FREE!
>
> "Jack" wrote in message news:39F772AF-A09D-4467-9C89-33B87D5BB32B@microsoft.com...
> > Hi, I am trying to run a sample code to see how it works. However, I am
> > getting the following error message:
> > Error Type:
> > ADODB.Recordset (0x800A0CC1)
> > Item cannot be found in the collection corresponding to the requested name
> > or ordinal.
> > /gwis/FSR_EditDetail_test2.asp, line 346
> >
> > THE CODE:
> > if mypage="Exp" then
> > sql01 = "SELECT ExpenditureTbl.* FROM ExpenditureTbl "
> > sql01 = sql01 & "WHERE ExpenditureTbl.GrantID = " & GrantID
> > end if
> >
> > if mypage = "Inc" then
> > sql01 = "SELECT IncomeTbl.* FROM IncomeTbl "
> > sql01 = sql01 & "WHERE IncomeTbl.GrantID = " & GrantID
> > end if
> >
> > if mypage = "Forf" then
> > sql01 = "SELECT ForfeitureTbl.* FROM ForfeitureTbl "
> > sql01 = sql01 & "WHERE ForfeitureTbl.GrantID = " & GrantID
> > end if
> > 'write out the detail information from the database for Exp, Inc or Forf.
> >
> > 'response.write "Sue SQL:" & sql01
> > rstemp1.Open sql01
> > 'set rstemp=conntemp.execute(sql01)
> > Do until rstemp1.eof
> > i = i + 1
> > response.write "" & vbCRLF
> >
> > if MyPage="Exp" then
> > strLink = "" & vbCRLF
> > end if
> >
> > if MyPage="Inc" then
> > strLink = "" & vbCRLF
> > end if
> >
> > if MyPage="Forf" then
> > strLink = "" & vbCRLF
> > end if
> >
> > response.write strLink & vbCRLF
> > if session("locked")<>"Y" then
> > if MyPage="Exp" Then
> > strLink = " > > HREF='ConfirmDeleteExpLine.asp?ExpenditureID=" & rstemp("ExpenditureID") &
> > "&PageType="&mypage&"&Max="&max&"'>Delete
" & vbCRLF
> > end if
> >
> > if MyPage="Inc" then
> > strLink = " > > HREF='ConfirmDeleteExpLine.asp?ExpenditureID=" & rstemp("IncomeID") &
> > "&PageType="&mypage&"&Max="&max&"'>Delete
" & vbCRLF
> > end if
> >
> > if MyPage="Forf" then
> > strLink = " > > HREF='ConfirmDeleteExpLine.asp?ExpenditureID=" & rstemp("ForfeitureID") &
> > "&PageType="&mypage&"&Max="&max&"'>Delete
" & vbCRLF
> > end if
> >
> > response.write strLink & vbCRLF
> > else
> > strLink = "" & vbCRLF
> > response.write strLink & vbCRLF
> > end if
> >
> > If rstemp1("ClaimNo") = "" then
> > strLink = " > > TYPE='text' SIZE=6 NAME='ClaimNo_"& i & "' VALUE='" & rstemp("ClaimNo") &
> > "'>" & vbCRLF
> > else
> > strLink = " > > NAME='ClaimNo_"& i & "' VALUE='" & rstemp("ClaimNo") & "'>" & vbCRLF
> > end if
> >
> > response.write strLink & vbCRLF
> >
> > strLink = " > > NAME='Expmonth_" & i & "'VALUE='" & month(rstemp("ExpDate")) & "'>/ > > TYPE='text' SIZE=1 NAME='ExpDay_" & i & "'VALUE='" & day(rstemp("ExpDate")) &
> > "'>/ " & vbCRLF
> >
> >
> > 'continue to write out the detail line
> >
> > response.write strLink & vbCRLF
> >
> > strLink = " > > NAME='PaidTo_" & i & "' VALUE='" & rstemp("WhomPaid") & "'>" & vbCRLF
> > response.write strLink & vbCRLF
> > strLink = "" &
> > formatcurrency(rstemp("Amount")) & "" & vbCRLF
> > response.write strLink & vbCRLF
> > strLink = " > > NAME='Personnel_" & i & "' VALUE='" & rstemp("Personnel") & "'
> > style='text-align: right;'>" & vbCRLF
> > response.write strLink & vbCRLF
> > strLink = " > > NAME='ContServ_" & i & "' VALUE='" & rstemp("ContServ") & "'
> > style='text-align: right;'>" & vbCRLF
> > response.write strLink & vbCRLF
> > strLink = " > > NAME='Travel_" & i & "' VALUE='" & rstemp("Travel") & "' style='text-align:
> > right;'>" & vbCRLF
> > response.write strLink & vbCRLF
> > strLink = " > > NAME='Equipment_" & i & "' VALUE='" & rstemp("Equipment") & "'
> > style='text-align: right;'>" & vbCRLF
> > response.write strLink & vbCRLF
> > strLink = " > > NAME='OperExp_" & i & "' VALUE='" & rstemp("OperExp") & "' style='text-align:
> > right;'>" & vbCRLF
> > response.write strLink & vbCRLF
> > response.write "" & vbCRLF
> > rstemp1.movenext
> > loop
> > rstemp1.Close
> > %>
> >
> > The error is in the following line:
> > strLink = "" & vbCRLF
> >
> > I could not figure out why the error is happening. Any help is appreciated
> > in advance.
>
>