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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type mismatch error in array declaration

Status
Not open for further replies.

frogggg

Programmer
Jan 17, 2002
182
US
The strangest thing!
Here's my code - I keep getting the type mismatch error on the declaration, or even on the element declarations.
I have identical code in 5 other pages and I never got this error before.

dim intCount
for intCount = 0 to ubound(session.Contents("CandidateLocations"))

'write selected locations to db
'declare 2 arrays to hold field names and values
dim FieldsArray(1)
dim ValuesArray(1)

FieldsArray(0) = "LocationID"
ValuesArray(0) = session.Contents("CandidateLocations")(intCount)
FieldsArray(1) = "CandidateID"
ValuesArray(1) = session("CandID")

rsAddLocations.addImmediate FieldsArray, ValuesArray
next

The error is on the dim lines.
It must be some silly mistake, can someone help? Please?
 
Also, the first record in the loop writes to the db anyway, even with the type mismatch error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top