ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 3rd, 2003, 07:05 AM
andyyylz andyyylz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 14 andyyylz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question how to show the query results in ASP

Hello everyone:
I am trying to build an interactive web page. That page allows users to input whatever SQL query language, and return the corresponding results. Of course, it has been linked with database.
But till now, although I can use the recordset to store the query results, I can not show the results. Because I don't know which column will be chosen by user. Any method or function in ASP can help me to show all the columns in the recordset


Cheers

Reply With Quote
  #2  
Old July 3rd, 2003, 09:18 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
You can retrieve the field names from a recordset like this,

Code:
for each f in RS.Fields
    Response.Write("<td><b>" & f.Name & "</b></td>")
next
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old July 3rd, 2003, 12:37 PM
andyyylz andyyylz is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 14 andyyylz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It seems not to work. The each field name is dynamic.
eg: if user inputs "select f1,f2 from t1", it should show two fields.
if user inputs "select * from t1", it should show all fields.

I do not know how to display the field name dynamically.

cheers

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > how to show the query results in ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT