Loop for Not NULLS

Results 1 to 2 of 2

Thread: Loop for Not NULLS

  1. #1
    Join Date
    Dec 1969

    Default Loop for Not NULLS

    I&#039;m trying to create a loop that looks at each Request.Form object that is sent from a form to my "infochange.asp" file. Each time it finds a form field that isn&#039;t empty, it inserts that information in the proper field.<BR><BR>This is all I have to work with, as I&#039;m quite stuck after that...<BR><BR>For i = UBound(Request.Form())<BR> objNum = Request.Form(i)<BR>

  2. #2
    Join Date
    Dec 1969

    Default For Each...

    When you say "in the proper field" do you mean into a record field?<BR><BR>And are your form fields named exactly the same as your record fields?<BR><BR>If so...<BR><BR>&#060;%<BR>Set RS = Server.CreateObject("ADODB.Recordset")<BR>RS.Open "yourTableName", yourConnection, adOpenStatic, adLockOptimistic<BR><BR>RS.AddNew<BR><BR>For Each fldname In Request.Form<BR> val = Trim( Request.Form(fldname) )<BR> If val &#060;&#062; "" Then<BR> RS(fldname) = val<BR> End If<BR>Next<BR>RS.Update<BR>%&#062;<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