|
|
 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

February 24th, 2006, 09:27 PM
|
|
Authorized User
|
|
Join Date: Nov 2005
Location: , , .
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Get Field Names
Is there a way to get all field names in a table without returning an entire recordset? This works, but it returns everything which is probably unneccessary:
<%
Dim sSQL
Dim Field
Dim oRS
sSQL = "SELECT * FROM table"
Set oRS=Server.CreateObject("ADODB.RecordSet")
oRS.Open sSQL, "DSN=dbname"
For Each Field in oRS.Fields
Response.Write Field.Name
Next
%>
|

February 25th, 2006, 05:06 AM
|
 |
Wrox Author
Points: 33,554, Level: 80 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,228
Thanks: 7
Thanked 203 Times in 201 Posts
|
|
Hi there,
You can add a WHERE clause that returns no records:
sSQL = "SELECT * FROM table WHERE SomeColum = 'Some Condition that is never true'"
That way, you still get the meta data but not the records....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |