Please excuse me if this is the wrong forum. I hope your combined genius will be able to point me in the right direction.I have an ASP page that accepts any SQL query. I want to create a table based on the result set so the number of columns can grow/shrink. But I don't know how. Can anyone help me?My ASP Code shows how I create a table with only 8 fields.<%Dim objConndim SQLstmtDim objRSDim SQLqryDim UIDDim RecordArrayDim IUID = right(Request.ServerVariables("AUTH_USER"),8)SQLqry = Request.Form("qry")Set objConn = Server.CreateObject("ADODB.Connection")objConn.ConnectionString="Trusted_Connection=yes;driver=SQL Server;server=Server;database=db;"objConn.Open If SQLqry = "" then Response.Write "Please Enter a SQL Query" ElseSet objRS = objConn.Execute(SQLqry) Response.Write "<H5 align = ""center"">" & sqlqry & "</H5>"Response.Write "<Table align = ""center"" border = ""1"">"For I = 0 To objRS.Fields.Count - 1 Response.Write "<TD><B>" & objRS(I).Name & "</B></TD>"Next Do while not objRS.EOF RecordArray = objRS.GetRows(30) For I = 0 To UBound(RecordArray,2) Response.Write "<TR>" Response.Write "<TD>" & RecordArray(0,I) & "</TD>" Response.Write "<TD>" & RecordArray(1,I) & "</TD>" Response.Write "<TD>" & RecordArray(2,I) & "</TD>" Response.Write "<TD>" & RecordArray(3,I) & "</TD>" Response.Write "<TD>" & RecordArray(4,I) & "</TD>" Response.Write "<TD>" & RecordArray(5,I) & "</TD>" Response.Write "<TD>" & RecordArray(6,I) & "</TD>" Response.Write "<TD>" & RecordArray(7,I) & "</TD>" Response.Write "</TR>" Next Loop Response.Write "</TABLE>" objRS.close objConn.close set objRS=nothing set objConn=nothingEnd if%>