Using Arrays and printing them out ?

Results 1 to 2 of 2

Thread: Using Arrays and printing them out ?

  1. #1
    Patty Guest

    Default Using Arrays and printing them out ?

    my SQL statement:<BR>Equipements = "SELECT *"<BR>Equipements = Equipements + " FROM tbl_equipement, tbl_voiture_equipement "<BR>Equipements = Equipements + " WHERE tbl_voiture_equipement.VEid_voiture_int = "& RCarDetails.fields(0).value<BR>Equipements = Equipements + " AND tbl_equipement.EID_equipement_int = tbl_voiture_equipement.VEid_equipement_int"<BR><BR >set REquipements = conn.execute(Equipements)<BR><BR>dim arrEquip()<BR>yE=0<BR><BR>I have an SQL SELECT statement where I get certain values from a MsAccess DB table. My question is how do I put these values into an Array and retreive them using the DO WHILE of my SQL statement?<BR><BR>I&#039;ve tried to do the following but just kept giving me errors such as : Subscript out of range<BR><BR>DO WHILE NOT REquipements.EOF<BR> arrEquip(yE) = REquipements.fields(1).value<BR> yE=yE+1<BR> response.write("<BR>&#060;input type=&#039;checkbox&#039; name=&#039;OEquipement&#039; value=&#039;"& REquipements.fields(0).value &"&#039; CHECKED&#062;&#060;font face=&#039;verdana, arial&#039; size=&#039;1&#039;&#062;"& REquipements.fields(1).value &"&#060;/font&#062;")<BR> REquipements.MOVENEXT<BR> LOOP<BR><BR>what I intend to do is print out the complete list of equipments that are in my tbl_equipments and at the same time, check (tick) the ones that are in my SQL statement above.<BR><BR>Is there another way to print and check my equipments checkboxes?<BR><BR>Any help would be greatly appreciated.<BR>Thank you<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Using Arrays and printing them out ?

    You need to redim your dynamic array!<BR><BR>dim arrEquip()<BR>yE=0<BR><BR>DO WHILE NOT REquipements.EOF<BR> &#039; ***** Add this line of code<BR> Redim Preserve arrEquip(yE)<BR> &#039; *****<BR> arrEquip(yE) = REquipements.fields(1).value<BR> yE=yE+1<BR> REquipements.MOVENEXT<BR>LOOP<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts