Hi all, I am in desperate need of help. I know the method by which i'm doing this is much too convoluted than it should be but I'm afraid I'm not that great with ASP 
Basically, I have a input type textbox with the name sqlbox which upon Submit goes to an ASP function. In the ASP function, I have to accomodate every possible command by using Nested if loops. For example, if the user only wanted the first name returned, then I create an if statement asking if that's what's in the text box and if so create the relevant cells.
Here is *some* my code
Is there something like Java where I can use MetaData to predetermine how many columns are going to be needed and then create and name the columns based on that? Or a better method?
Please please help!
Basically, I have a input type textbox with the name sqlbox which upon Submit goes to an ASP function. In the ASP function, I have to accomodate every possible command by using Nested if loops. For example, if the user only wanted the first name returned, then I create an if statement asking if that's what's in the text box and if so create the relevant cells.
Here is *some* my code
Code:
<%
If Request("submit") = "Send" Then
If ("sqlbox") = "SELECT+Name+FROM+Customers" Then
Response.Write("sqlbox")
sSQL=Request("sqlbox")
Set Rs = Conn.Execute(sSQL)
Response.Write("<table align='center' width='80%' class='ex' cellpadding='0' cellspacing='0'>")
Response.Write("<tr><td class='header'>Name</td></tr>")
Do While NOT Rs.EOF
Response.Write("<tr><td class='tdex'> ")
Response.Write(Rs.Fields("Name").value)
Response.Write("</td></tr>")
Rs.MoveNext
Loop
Response.Write("</table><br><br>")
Else If ("sqlbox") = "SELECT Name, Email FROM Customers" Then
Response.Write("Something Else")
Else
Response.Write("None at all")
End If
End If
Else If Request("reset") = "Reset" Then
sSQL="SELECT * FROM Customers"
Set Rs = Conn.Execute(sSQL)
Response.Write("Reset")
Response.Write("<table align='center' width='80%' class='ex' cellpadding='0' cellspacing='0'>")
Response.Write("<tr><td class='header'>Name</td><td class='header'>Email</td><td class='header'>Points</td></tr>")
Do While NOT Rs.EOF
Response.Write("<tr><td class='tdex'> ")
Response.Write(Rs.Fields("Name").value)
Response.Write("</td><td class='tdex'>  ")
Response.Write(Rs.Fields("Email").value)
Response.Write("</td><td class='tdex'>  ")
Response.Write(Rs.Fields("Points").value)
Response.Write("</td></tr>")
Rs.MoveNext
Loop
Response.Write("</table><br><br>")
else
Response.Write("Nothing...")
sSQL="SELECT * FROM Customers"
Set Rs = Conn.Execute(sSQL)
Response.Write("<table align='center' width='80%' class='ex' cellpadding='0' cellspacing='0'>")
Response.Write("<tr><td class='header'>Name</td><td class='header'>Email</td><td class='header'>Points</td></tr>")
Do While NOT Rs.EOF
Response.Write("<tr><td class='tdex'> ")
Response.Write(Rs.Fields("Name").value)
Response.Write("</td><td class='tdex'>  ")
Response.Write(Rs.Fields("Email").value)
Response.Write("</td><td class='tdex'>  ")
Response.Write(Rs.Fields("Points").value)
Response.Write("</td></tr>")
Rs.MoveNext
Loop
Response.Write("</table><br><br>")
End If
End If
%>
Is there something like Java where I can use MetaData to predetermine how many columns are going to be needed and then create and name the columns based on that? Or a better method?
Please please help!