How to display a table from SQL from ASP
I am looking for ASP code that accepts a table name in a SQL database
and display the contents of the the table by finding the column names
of the table in the SQL Server table.
Thanks
Karen
Re: How to display a table from SQL from ASP
set rs = yourADOObject.Execute("SELECT * FROM " & tableName)
If Not rs.EOF Then
Response.Write "<table><tr>"
For Each col in rsResults.Fields
Response.Write "<th>" & col.Name & "</th>" & vbCrLf
Next
Response.Write "</tr>"
sTBody = rsResults.GetString(2, -1, "</td><td>", "</td></tr><tr><td>")
sTBody = Left(sTBody, Len(sTBody) - Len("<tr><td>"))
Response.Write "<tr><td>" & sTBody
Response.Write "</table>"
End If
Ray at work
<karenmiddleol [at] yahoo.com> wrote in message
news:1128371801.743197.117370 [at] o13g2000cwo.googlegroups.com.. .
>I am looking for ASP code that accepts a table name in a SQL database
> and display the contents of the the table by finding the column names
> of the table in the SQL Server table.
>
> Thanks
> Karen
>
Re: How to display a table from SQL from ASP
Universal DB Viewer
http://www.asp101.com/samples/db_dsn.asp
Reads properties, tables, and table data from a database.
TableEditoR
http://www.2enetworx.com/dev/projects/tableeditor.asp
Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample
<<
I am looking for ASP code that accepts a table name in a SQL database
and display the contents of the the table by finding the column names
of the table in the SQL Server table.
>>
*** Sent via Developersdex http://www.developersdex.com ***