Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Location
    SW England
    Posts
    102

    Unanswered: loop to retrieve form field names not working.

    Any ideas why this isn't working?

    Code:
    Dim sMessage
    	
    		for each field in request.form
    			if sMessage = "" Then
    				sMessage = field & " = " & request.form(field)
    			Else
    				sMessage = sMessage & (Chr(10)) & field & " = " & request.form(field)
    			End If
    		Next
    		response.write(sMessage)
    It is not outputting anything. and no apparent errors.

    Later I want the code to build an SQL INSERT string using the field names as DB column names, but I'll get to that when this bit is working!

    thanks
    M

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by darkmunk
    Any ideas why this isn't working?
    Probably because SQL Server can't parse vb script

    Moving to asp forum or somewhere like that.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Oct 2005
    Location
    SW England
    Posts
    102

    Red face

    sorry, it was leading to a really useful script to generate SQL strings which I have now accomplished. but you don't apear to want them.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I'm not quite sure what you mean. My point was that your problem was with asp but you posted in the SQL Server forum. I therefore moved the thread to the appropriate forum.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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