If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > loop to retrieve form field names not working.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-02-07, 08:08
darkmunk darkmunk is offline
Registered User
 
Join Date: Oct 2005
Location: SW England
Posts: 102
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
Reply With Quote
  #2 (permalink)  
Old 06-02-07, 10:20
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
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:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #3 (permalink)  
Old 06-02-07, 11:39
darkmunk darkmunk is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 06-02-07, 11:53
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
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:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On