C
connollyg
Guest
I want to fill an array with data from a record, currently i have a record that looks like this:-
Key autonum
desc text
Pos01 number
Pos02 number
.
.
.
Pos99 number
and i am trying to use the following code to fill the array
'
SQL_statement = "SELECT * FROM PointsBasis WHERE PointsBasis.PointsID="&rst1("PointsBasisID")&";"
Set rst1 = db.Execute(SQL_statement)
For iL_I = 1 To 99
aa = chr(34)+"Pos"&Right("00"&Cstr(iL_I),2)+chr(34)
response.write ">"& aa &"<"
' aG_Points(iL_I) = rst1(aa)
Next
This is the kind of output i get from the response.write
>"Pos01"<
>"Pos02"<
>"Pos03"<
>"Pos04"<
but if i uncomment the statement following the response.write i get
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/Results/Results_Service2.asp, line 605
but if i change the statement to this
' aG_Points(iL_I) = rst1("Pos01")
It works fine.
Am i doing this the right way and if so what is wrong with my code?
G
Key autonum
desc text
Pos01 number
Pos02 number
.
.
.
Pos99 number
and i am trying to use the following code to fill the array
'
SQL_statement = "SELECT * FROM PointsBasis WHERE PointsBasis.PointsID="&rst1("PointsBasisID")&";"
Set rst1 = db.Execute(SQL_statement)
For iL_I = 1 To 99
aa = chr(34)+"Pos"&Right("00"&Cstr(iL_I),2)+chr(34)
response.write ">"& aa &"<"
' aG_Points(iL_I) = rst1(aa)
Next
This is the kind of output i get from the response.write
>"Pos01"<
>"Pos02"<
>"Pos03"<
>"Pos04"<
but if i uncomment the statement following the response.write i get
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/Results/Results_Service2.asp, line 605
but if i change the statement to this
' aG_Points(iL_I) = rst1("Pos01")
It works fine.
Am i doing this the right way and if so what is wrong with my code?
G