September 9th, 2011, 12:48 PM
Join Date: Sep 2011
Time spent in forums: 33 sec
Reputation Power: 0
Database fields to reference Arrays in ASP
As a relative beginner to ASP, please do not scream NEWBIE too loudly when reading/answering...
I have an ASP page that displays items for a user to choose by clicking a radio button to select. Rather than manually build each item's display I have stored all the attributes of the item in an Access database and build the display dynamically.
Since I need to reference the items later I load the attributes into arrays like this:
itemrow = 0
Do While Not recordset.EOF
itemradio(itemrow) = Recordset("radname")
itemdesc(itemrow) = Recordset("Item")
itemcost(itemrow) = Recordset("itemcost")
itemvalue(itemrow) = Recordset("itemvalue")
itemimage(itemrow) = Recordset("Image")
itemrow = itemrow + 1
In the database radname would contain values like:
When the form is submitted, I grab the value and store it in a field.
for (var i=0; i < document.form1.group1.length; i++)
var rad_val = document.form1.group1[i].value;
document.form1.chose.value = rad_val;
Here is where I have issues. I am sure it is something I am doing or perhaps the type of field in the database that is causing it, but when I attempt to reference the information using the code below I constantly get a Type Mismatch no matter what type of field I set it to in the Access database.
varchose = Request.form("chose")
Is there some type of conversion I need to do? I have tried setting the database field to text length 2, long, integer etc.
ANY help would be so greatly appreciated!!
Thanks in advance!