p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   SQL Server ASP (http://p2p.wrox.com/forumdisplay.php?f=101)
-   -   help writing dynamic form data to dynamic table (http://p2p.wrox.com/showthread.php?t=58629)

ublend June 1st, 2007 05:11 AM

help writing dynamic form data to dynamic table
I have a dynamic form and a dynamic table (both generated by an asp 'wizard'), so I need a dynamic way of writing the form data from the dynamic form to the dynamic table.
So far, I can get the table field names and the form field names (both in order), but I cannot seem to get the loop(s) right to marry the two. Any ideas? A sample would be terrific. I am under a deadline, so any responses are greatly appreciated.


ublend June 1st, 2007 08:09 AM

Quick thanks to all who viewed my question --
I figured out that I was overthinking the process when the solution was pretty simple. The key to it was remembering that the dynamic form element names are always the same as the dynamic table field names for this application. Here is a sample of the code for those who may ask the same question in the future:
Set RSC = Server.CreateObject("ADODB.Recordset")
RSC.Open myTable, Conn, 2, 2
      For ix = 1 to Request.Form.Count-1
      RSC(Request.Form.Key(ix)) = Request.Form.Item(ix)

All times are GMT -4. The time now is 01:03 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.