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
karenmiddleol [ Mo, 03 Oktober 2005 22:36 ] [ ID #995047 ]

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
>
my first name at lane [ Di, 04 Oktober 2005 20:42 ] [ ID #996588 ]

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 ***
SteveB [ Mi, 05 Oktober 2005 08:12 ] [ ID #998294 ]
Webserver » microsoft.public.inetserver.asp.db » How to display a table from SQL from ASP

Vorheriges Thema: Display form and read the database from the same page
Nächstes Thema: update from using ms access query