Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Could someone please explain what t

Status
Not open for further replies.

sknyppy

Programmer
May 14, 1999
137
US
Could someone please explain what this error means to me?

Item cannot be found in the collection corresponding to the requested name or ordinal.



If Not IsEmpty(Request.QueryString("EventID")) then
qGetConstructionDetails = "SELECT * FROM tbl_construction_events WHERE EventID = "&Request.QueryString("EventID")
SET ConstructionDetails = adoDataConn.Execute(qGetConstructionDetails)
For X = 1 to 1
qCopyIncident = "INSERT INTO tbl_dynamic_events "&_
"(CategoryID,EventTypeID,RegionID,CityID,EventText,CreatedOn,Persistence,Expiration) "&_
"VALUES('"&ConstructionDetails("CategoryID")&"',"&_
"'"&ConstructionDetails("EventTypeID")&"',"&_
"'"&ConstructionDetails("RegionID")&"',"&_
"'"&ConstructionDetails("CityID")&"',"&_
"'"&ConstructionDetails("EventText")&"',"&_
"'"&ConstructionDetails("LogDateTime")&"',"&_
"'no',"&_
"'"&ConstructionDetails("TimeToExpire")&"'"&_
")"
adoDataConn.Execute(qCopyIncident)
Next
End If

Thanks, Dave
 
You have tried requesting a field from the recordset that does not exist.
You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
may be a misspelling or case issue. or it may just not exist You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
It means that one of the columns you are referencing was not found in your recordset. One way to fix this is to write out the columns that you need in your SQL statement rather than using SELECT *.

So try something like this:

qGetConstructionDetails = "SELECT CategoryID, EventTypeID, RegionID, CityID, etc... FROM tbl_construction_events WHERE EventID = "&Request.QueryString("EventID")
 
I have everything spelled out and I'm positive they exist.

If Not IsEmpty(Request.QueryString("EventID")) then
qGetConstructionDetails = "SELECT CategoryID,EventTypeID,RegionID,CityID,EventText,CreatedOn,Persistence,Expiration FROM tbl_construction_events WHERE EventID = "&Request.QueryString("EventID")
SET ConstructionDetails = adoDataConn.Execute(qGetConstructionDetails)
For X = 1 to 1
qCopyIncident = "INSERT INTO tbl_dynamic_events "&_
"(CategoryID,EventTypeID,RegionID,CityID,EventText,CreatedOn,Persistence,Expiration) "&_
"VALUES('"&ConstructionDetails("CategoryID")&"',"&_
"'"&ConstructionDetails("EventTypeID")&"',"&_
"'"&ConstructionDetails("RegionID")&"',"&_
"'"&ConstructionDetails("CityID")&"',"&_
"'"&ConstructionDetails("EventText")&"',"&_
"'"&ConstructionDetails("LogDateTime")&"',"&_
"'no',"&_
"'"&ConstructionDetails("TimeToExpire")&"'"&_
")"
adoDataConn.Execute(qCopyIncident)
Next
End If
 
But in your SQL statement you have the column "Expiration" and where you are calling the columns to build your insert statement, you are referencing "TimeToExpire", for instance. Make sure that you are referencing all the proper column names.

So I can see that the columns "TimeToExpire" and "LogDateTime" do not exist in your sql statement.
 
this is the total error disc. right?

ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.

these fields are case sensitive also.
This is the only reasoning behind this error. You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top