Sorry for the ambiguous title, not quite sure how to explain this. Basically what I have is an ASP page that will dynamically build a 'form' based upon information from a Database. The DB holds information such as what type of options to give the user (radial, checkboxes, drop down, text box...) along with what the information that should be displayed.
All of this builds perfectly fine. However, now I have a situation in which I want to add in that the DB will also store known variables to assign to certain sections. For example, if we know the logged in user is 'Danny' then any place within the forms that it loads, I want it to grab my name.
So in the DB I added a new column for these sections which indicates what variable to call. However, if I simply 'grab' this variable from the DB it is simply going to print it. How can I pass the variable that I am grabbing from the DB and tell my ASP page that I want it to use a matching variable that it has.
I am hoping to avoid using something as static as If or Case statements. The ultimate goal is for the variable we are grabbing from the first table to be able to inform the ASP page of what variable to use from another DB call it is making.
For example: The first DB call is to 'rsForms' and the second DB call is 'rsEmployee'. The rsForm("question") is 'First Name' and within that rsForm("variable") column we put 'FirstName'. The hope being that we could do something like rsEmployee("rsForm("Variable")").
So each time that the rsForms("Variable") field is not null, it would use a separate statement which is prefilling the value of the Form with the information from rsEmployee using the field that is being specified by the rsForms("Variable") value.