This topic is locked

Object Required Error Version 766

2/23/2009 6:04:55 PM
ASPRunnerPro General questions
D
dlangham author

Hi,
I am using the following script in the Before Add section of a page, and it works perfectly as it adds the data into a tracking table.

The problem is that I need to create numerous copies of this page, I have created another copy of this page by using "Create Custom View" and then I rename this new page to something else, when I try to Edit a record with this new page I get an ASPRunner Error in the browser telling me that an Object is required, if I remove this script from the page then the Edit works OK but doesn't insert the data into the tracking table, the original page still works OK, could this be a bug?
set rsFields = dal.Table(strTableName).Query(where,"")

if not rsFields.eof then

dal.Table("PMT_PATCH_TRACKING").[ID]=rsFields("ID")

dal.Table("PMT_PATCH_TRACKING").[PMT_USER_ID]=rsFields("PMT_USER_ID")

dal.Table("PMT_PATCH_TRACKING").[ENVIRONMENT]=rsFields("ENVIRONMENT")

dal.Table("PMT_PATCH_TRACKING").[MSPATCH]=rsFields("MSPATCH")

dal.Table("PMT_PATCH_TRACKING").[MS_KB_REF]=rsFields("MS_KB_REF")

dal.Table("PMT_PATCH_TRACKING").[STATUS]=rsFields("STATUS")

dal.Table("PMT_PATCH_TRACKING").[SEVERITY]=rsFields("SEVERITY")

dal.Table("PMT_PATCH_TRACKING").[ADDED_BY]=Session("full_name")

dal.Table("PMT_PATCH_TRACKING").[DATE_TIME_ADDED]=rsFields("DATE_TIME_ADDED")

dal.Table("PMT_PATCH_TRACKING").[LAST_UPDATE]=rsFields("LAST_UPDATE")

dal.Table("PMT_PATCH_TRACKING").[CURRENT_DATE_TIME]=rsFields("CURRENT_DATE_TIME")

dal.Table("PMT_PATCH_TRACKING").Add()

end if

rsFields.close: set rsFields=nothing
BeforeEdit = True

Sergey Kornilov admin 2/23/2009

Answered to your personal email.

N
NigelEtienne 3/11/2009

Can you pleasse post the answer here as I am having the same problem.
Regards

Sergey Kornilov admin 3/11/2009

It was caused by coding error in event. Incorrect syntax.
Post your code here and we'll help you.

N
NigelEtienne 3/11/2009

It was caused by coding error in event. Incorrect syntax.

Post your code here and we'll help you.


Hi Sergy

I have various table containing data about roles and competencies associated with those roles. I have created a view that "pulls" them together into a single list based on the user's role i.e. if you are in accounts your competencies would include numerancy. What I am trying to do is to copy the list into another table so the user can mark themselves against each competency.
My code on the "Edit Page - Before Display" with "BeforeShowEdit(xt,templatefile)" event is

'str = "select * from Questionnaire where [UserID]=" & Session("UserID")

'Set rsFields = server.CreateObject("ADODB.Recordset")

'rsFields.open str,dbConnection

'

'Session("RID")= rsFields("Title")

'Session("MID")= rsFields("Manager")

'Session("SCID")= rsFields("BMSkillsCoreID")

'Session("SAID")= rsFields("BMSkillsAreaID")

'Session("BMBM")= rsFields("BMBenchMark")

'

'rsFields.close: set rsFields=nothing
and
My code on the "Edit Page - Before Record Updated" with "Function BeforeEdit(dict, where, oldvalues,keys,message,inline" event is

'** Insert a record into another table ****

dal.UserCompetenciesForm.UserID=Dict("UserID")

dal.UserCompetenciesForm.RoleID=Dict("RID")

dal.UserCompetenciesForm.ManagerID=Dict("MID")

dal.UserCompetenciesForm.UCoreSkillsID=Dict("SCID")

dal.UserCompetenciesForm.USkillsAreaID=Dict("SAID")

dal.UserCompetenciesForm.BenchmarkScore=Dict("BMBM")

dal.UserCompetenciesForm.Update()
BeforeEdit = True

I have tried to populate the table "UserCompetenciesForm" directly from the list but kept getting error 438 - Object doesn't support this property or method.
I would be very grateful for any help.
Regards

Sergey Kornilov admin 3/11/2009

I guess one of field names is spelled wrong.
I recommend to post your application to Demo Account (use 'Demo Account' button on the last screen in program). Then open a ticket at http://support.xlinesoft.com sending your Demo Account URL for investigation.