Forums
This topic is locked
Comparing data
23 Nov 2001 10:31:14 Bec C posted:
Can anybody shed any light on this...I have pages which asks the user a series of questions. The values are held in a hidden field. The field may look like sport-like,cinema-notlike,music-like
On reaching the results page I break the answer field string up into an array e..g
answer(0) = sport-like
answer(1) = cinema-notlike
answer(2) = music-like
From this I then loop through each record in a database. I split up a field within the db into an array as well. This is used to then pull the records based on what the user likes or dislikes.
I loop through the answerArray first and then sub loop through the databaseArray
From this I compare answerArray to the databaseArray
If equal (using code: If strComp(answersArray(i), databaseArray(n), vbBinaryCompare) = 0 then (a zero is passed if both strings are equal)) I set up dictionary object.
I have also tried using a plain if value1 = value2 then and this does not work.
The data comparison works fine on the answerArray(0) but when I loop back through e.g. answerArray(1) =databaseArray(n) it does not find an exact comparison within the data even though the text is exactly the same.
Its driving me mad at the moment so any help would be great!