Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strategy for many controls

Status
Not open for further replies.

behbeh

Programmer
Mar 10, 2001
48
US
I'm a Windows programmer and need to throw together quickly several web pages. The forms have many, many controls (at least 100 checkboxes and at least 70 textboxes)and will change every month. I don't want to create a different table in SQL Server every month to accomodate the responses for these forms. My approach was to build the table vertically, instead of 170+ fields across; with this approach, a different table would not need to be created every month.
Is it possible to efficiently UPDATE the database as well as populate the controls in ASP, where all the controls would be for the same 'result' field, instead of each control bound to a different field in a table? I would probably need to collect the data sequentially from the web page, but I'm not too familiar with web apps to know if this is feasible. Or is there a better design for this to work efficiently over the web?
Any comments would be greatly appreciated!!!!!
 
When u recreate the table all the old information is erased? ________
George, M
 
I need to keep the old information for marketing research.
 
I use an method like this:
i have 2 tables
tblFields - stores how manny fields i have
id_field int
name varchar(50)

here put all my fields and i add the new one...

tblData - stores the values of all the fields i have in the tblFields
id_data int
number_of_fields int - store how many fields i have in the current record (from the first to the last one)
data varchar - stores all the data

when i need to insert an reccord in tblData (a new form register info) i combine the values separated by an grop of chars ie i use "^^"
note: all the fields in the form have the same name "formFields"

data=request.form("formFields")
nr_of_fields=request.form("formFields").count

data=split(data,",") 'create an array from the submit data
alldata=Join(data,"^^")'combine the array data with delimiters

'insert the all data into tblData

when u need to add a new field just insert it into tblFields
when u need to get out data from tblData u use data=Split(datafromdatabase,"^^") and it creates an array with your values...

If u need more help please tell me...
shaddow11_ro@yahoo.com ________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top