Hello Everyone,
I am getting a strange error from a ASP page I am working on.
ADODB.Fields error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/includes/Profile/subs/rep
air_tix.as
p, line 139
Now I know this error message usually comes from a query trying to reference a record that doesn't exist. The wierd part is the SQL query is:
<%
Dim Profile_Emp_Off_Rep, Off_Rep_SQL
Profile_Emp_Off_Rep = (Profile_Off_Repair_Tix_Em
p.Fields.I
tem("SREP_
CODE").Val
ue)
Off_Rep_SQL = "SELECT * FROM Kiosk_Tasks WHERE REP_ID = '" & Profile_Emp_Off_Rep & "' ORDER BY RepairID DESC"
Response.Write(Off_Rep_SQL
)
%>
THE Page writes out:
SELECT * FROM Kiosk_Tasks WHERE REP_ID = 'M3M' ORDER BY RepairID DESC
then runs the following:
<%
Dim Profile_Off_repair_Tasks
Dim Profile_Off_repair_Tasks_c
md
Dim Profile_Off_repair_Tasks_n
umRows
Set Profile_Off_repair_Tasks_c
md = Server.CreateObject ("ADODB.Command")
Profile_Off_repair_Tasks_c
md.ActiveC
onnection = MM_SmartMain_V3_STRING
Profile_Off_repair_Tasks_c
md.Command
Text = Off_Sup_SQL
Profile_Off_repair_Tasks_c
md.Prepare
d = true
Profile_Off_repair_Tasks_c
md.Paramet
ers.Append
Profile_Off_repair_Tasks_c
md.CreateP
arameter("
param1", 200, 1, 50, Profile_Off_repair_Tasks__
MMColParam
) ' adVarChar
Set Profile_Off_repair_Tasks = Profile_Off_repair_Tasks_c
md.Execute
Profile_Off_repair_Tasks_n
umRows = 0
%>
And the SQL statement doesn't error out.
Now the strange thing is, if I do:
<%=(Profile_Off_repair_Tas
ks.Fields.
Item("Repa
irID").Val
ue)%>
It will error but if I do:
<%=(Profile_Off_repair_Tas
ks.Fields.
Item("Deta
ils").Valu
e)%>
it works fine. Details is just another record in the same table. Also if I go to SQL view in the database and cut and paste the above select statement that I wrote out above it works fine and I see the records? Am I dealing with reserved words or something here? Any help would be greatly appreciated.
Start Free Trial