Home | Advertising Info77 USERS CURRENTLY ONLINE   
   Site Search Contact Us Friday, March 14, 2025  
 
 


 
ASPProtect
User Management Application with web based screens that allow you to manage users.
www.ASPProtect.com
 
ASPBanner
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
www.ASPBanner.com
 
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
www.ASPPhotoGallery.com
 
ASPClassifieds
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.
www.ASPClassifieds.com



DISCUSSION ARCHIVES
 



We didn't realize
the site was so popular.

Other Stuff
 

 
 
Active Server Pages ASP control controls class classes module script Scripts applet CJWSoft ASPProtect ASPBanner ASPClassifieds



(Advanced)  (Components)  (Database)  (General)  (Vbscript)




ASPProtect

 
Subject: Updating Database with a Loop?
From: Scott Stevens
Date: 2/1/2001 1:15:35 AM
IP: 198.143.232.136



 

I have a page with many input fields, after hitting "Continue", the next page has asp code to write the previous values to a database. Since there are so many input fields, I would like to create a new record and input the data using a loop command, however the following code keeps giving me errors.

<%
' declaring variables
' not neccesary but a good habit
Dim DataConn
Dim CmdAddRecord
Dim MYSQL

Set DataConn = Server.CreateObject("ADODB.Connection")
Set CmdAddRecord = Server.CreateObject("ADODB.Recordset")

DataConn.Open "DSN=employment"

MYSQL = "SELECT application.* FROM application"

CmdAddRecord.Open MYSQL, DataConn, 1, 3

CmdAddRecord.AddNew
FOR EACH el IN Request.Form
CmdAddRecord.Fields(el) = Request.Form(el)
NEXT
CmdAddRecord.Update



CmdAddRecord.Close
Set CmdAddRecord = Nothing
DataConn.Close
Set DataConn = Nothing
%>

Am I trying to use the "AddNew" feature incorrectly? Is there a way to process all the elements in a form, without writing them all out?

Thanks for your help.


 

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages ASP programs help tutorial tutorials routine routines jobs listserve mailinglist bulletin board bulletin boards programming snippet snippets CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com