I know that this is just a vague error message and that it's hiding the real error. But the error is a big mystery.
I have two pages that use the addImmediate method that work beautifully, and three that don't work at all, and give me this vague error.
Can someone help Please!
This code works fine:
dim FieldsArray(1)
dim ValuesArray(1)
for intCount = 0 to ubound(session.Contents("CandidateLocations"
)
FieldsArray(0) = "LocationID"
ValuesArray(0) = session.Contents("CandidateLocations"
(intCount)
FieldsArray(1) = "CandidateID"
ValuesArray(1) = session("CandID"
rsAddLocations.addImmediate FieldsArray, ValuesArray
next
This code does not work at all:
'dim 2 arrays one for field names and one for values
dim eduFieldsArray(8)
dim eduValuesArray(8)
'loop through setting values of array elements = values from querystring & i
dim i
for i=0 to numEducation
'dim variables for fields
dim candID
candID = session("CandID"
dim schoolName
schoolName = Request.QueryString("txtSchool" & i)
dim city
city = Request.QueryString("txtCity" & i)
dim state
state = Request.QueryString("txtState" & i)
dim country
country = Request.QueryString("txtCountry" & i)
dim degreeLevel
degreeeLevel = request.QueryString("selDegreeLevel" & i)
dim completeDate
completeDate = Request.QueryString("txtCompleteDate" & i)
dim description
description = Request.QueryString("txtDescription" & i)
'fill values
eduFieldsArray(0) = "CandidateID"
eduValuesArray(0) = candID
eduFieldsArray(1) = "EducationID"
eduFieldsArray(2) = "SchoolName"
eduValuesArray(2) = schoolName
eduFieldsArray(3) = "City"
eduValuesArray(3) = city
eduFieldsArray(4) = "State"
eduValuesArray(4) = state
eduFieldsArray(5) = "Country"
eduValuesArray(5) = country
eduFieldsArray(6) = "DegreeLevel"
eduValuesArray(6) = degreeLevel
eduFieldsArray(7) = "CompletionDate"
eduValuesArray(7) = completeDate
eduFieldsArray(8) = "Description"
eduValuesArray(8) = description
dim maxEdID
maxEdID = rsGetMaxEdID.fields.getValue("maxEdID"
maxEdID = maxEdID + 1
'set educationID to next available number
eduValuesArray(1) = maxEdID
'update values
rsAddEducation.addImmediate eduFieldsArray, eduValuesArray
next
The reason for the & i business is because this comes from a form that the user chooses how many forms there will be, and since I can't know that ahead of time, I put a hidden field to pass the number of forms, and then named the textboxes, with each run of the loop, the next number. I know this method works, because before I added the addImmediate line, I was able to, using response.write, pull out all values from the querystring. Now it won't work.
Could it be because there are so many more values? But that's the whole benefit of addImmediate, to use it when there is a whole list.
I would be thrilled if someone would find my error!
Thanks in advance!
I have two pages that use the addImmediate method that work beautifully, and three that don't work at all, and give me this vague error.
Can someone help Please!
This code works fine:
dim FieldsArray(1)
dim ValuesArray(1)
for intCount = 0 to ubound(session.Contents("CandidateLocations"
FieldsArray(0) = "LocationID"
ValuesArray(0) = session.Contents("CandidateLocations"
FieldsArray(1) = "CandidateID"
ValuesArray(1) = session("CandID"
rsAddLocations.addImmediate FieldsArray, ValuesArray
next
This code does not work at all:
'dim 2 arrays one for field names and one for values
dim eduFieldsArray(8)
dim eduValuesArray(8)
'loop through setting values of array elements = values from querystring & i
dim i
for i=0 to numEducation
'dim variables for fields
dim candID
candID = session("CandID"
dim schoolName
schoolName = Request.QueryString("txtSchool" & i)
dim city
city = Request.QueryString("txtCity" & i)
dim state
state = Request.QueryString("txtState" & i)
dim country
country = Request.QueryString("txtCountry" & i)
dim degreeLevel
degreeeLevel = request.QueryString("selDegreeLevel" & i)
dim completeDate
completeDate = Request.QueryString("txtCompleteDate" & i)
dim description
description = Request.QueryString("txtDescription" & i)
'fill values
eduFieldsArray(0) = "CandidateID"
eduValuesArray(0) = candID
eduFieldsArray(1) = "EducationID"
eduFieldsArray(2) = "SchoolName"
eduValuesArray(2) = schoolName
eduFieldsArray(3) = "City"
eduValuesArray(3) = city
eduFieldsArray(4) = "State"
eduValuesArray(4) = state
eduFieldsArray(5) = "Country"
eduValuesArray(5) = country
eduFieldsArray(6) = "DegreeLevel"
eduValuesArray(6) = degreeLevel
eduFieldsArray(7) = "CompletionDate"
eduValuesArray(7) = completeDate
eduFieldsArray(8) = "Description"
eduValuesArray(8) = description
dim maxEdID
maxEdID = rsGetMaxEdID.fields.getValue("maxEdID"
maxEdID = maxEdID + 1
'set educationID to next available number
eduValuesArray(1) = maxEdID
'update values
rsAddEducation.addImmediate eduFieldsArray, eduValuesArray
next
The reason for the & i business is because this comes from a form that the user chooses how many forms there will be, and since I can't know that ahead of time, I put a hidden field to pass the number of forms, and then named the textboxes, with each run of the loop, the next number. I know this method works, because before I added the addImmediate line, I was able to, using response.write, pull out all values from the querystring. Now it won't work.
Could it be because there are so many more values? But that's the whole benefit of addImmediate, to use it when there is a whole list.
I would be thrilled if someone would find my error!
Thanks in advance!