trying to understand how to upload array to databa

Results 1 to 2 of 2

Thread: trying to understand how to upload array to databa

  1. #1
    Join Date
    Dec 1969

    Default trying to understand how to upload array to databa

    I successfully created an array, sent it to another page, collected as another array, now I need to upload that array to the database. Im almost there.. so someone check out this code.<BR><BR>so far I have my final array of ids that are ready to go to the db:<BR>ReDim arrayCheckBoxes(45) <BR>Dim intTotal <BR>intTotal = 0 <BR>For each item in Request.querystring<BR> If Left(item,4)="apps" Then <BR> arrayCheckBoxes(intTotal) = Request.Form(item) <BR>response.write item & ", " & (arrayCheckBoxes(intTotal)) & " " & vbCrLf <BR><BR> intTotal = intTotal + 1 <BR> End If <BR>Next <BR>ReDim preserve arrayCheckBoxes(intTotal) <BR><BR>from there I guess I need to know how to create a looping Insert Statement... Thanks for all your help

  2. #2
    Join Date
    Dec 1969

    Default You have already done it...

    Why do you need to create a *SEPARATE* loop to do the INSERTs? For that matter, why do you need that array?<BR><BR>Why not just:<BR><BR>For each item in Request.querystring<BR>&nbsp; &nbsp; If Left(item,4)="apps" Then <BR>&nbsp; &nbsp; &nbsp; &nbsp; thisCB = Request.Form(item) <BR>&nbsp; &nbsp; response.write item & ", " & thisCB & " " & vbCrLf &#039; optional<BR>&nbsp; &nbsp; conn.Execute( "INSERT INTO table (field1,field2...) Values( ...,&#039;" & thisCB & "&#039;,...)" )<BR>&nbsp; &nbsp; End If <BR>Next <BR>...<BR>%&#062;<BR><BR>??? See what I mean. If you need the array for other reasons, then by all means go ahead and create it. But you sure don&#039;t need it for doing the inserts.<BR><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