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 5th, 2007, 02:51 AM
30equals 30equals is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 3 30equals User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 7 sec
Reputation Power: 0
Asp & sql -- problem:order of table fields in query

hi everyone.

this is my first post here, and i'm looking forward to hang out here more often. so hi!

my problem is this:

i have a simple sql query to get results from a database table.
i'm not doing anything out of the ordinary. but some values do not get returned.

i kinda know the problem is the order in which the table fields are put in the query. when i reorder them, i get the results i wasn't getting at first, but then others don't come through.

no matter how many times i flip the order..i'm not able to get ALL of the table field results.. quite frustrating that is.

here's my query.

Code:
sSQL = "SELECT id, foto, fotourl , fotoalt, link1, link2,link1txt, link2txt, titel, txt FROM nieuwsbriefartikels WHERE p_id = '" & doc_id & "' AND actief='1' AND status='online' ORDER BY rank DESC"
	
	set oRs = oConn.Execute( sSQL )


and getting the results, i just do a simple

Code:
response.write(oRs("titel"))


etc


edit: maybe i should state, that with the query posted here. i don't get the link2 & link2txt results


thanx!

Reply With Quote
  #2  
Old August 17th, 2007, 01:52 AM
bhv bhv is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 55 bhv User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 25 m 19 sec
Reputation Power: 12
instead of specifying fields, you should use * in query.like

sql = "select * from FROM nieuwsbriefartikels WHERE p_id = '" & doc_id & "' AND actief='1' AND status='online' ORDER BY rank DESC"

hope this will help you


Quote:
Originally Posted by 30equals
hi everyone.

this is my first post here, and i'm looking forward to hang out here more often. so hi!

my problem is this:

i have a simple sql query to get results from a database table.
i'm not doing anything out of the ordinary. but some values do not get returned.

i kinda know the problem is the order in which the table fields are put in the query. when i reorder them, i get the results i wasn't getting at first, but then others don't come through.

no matter how many times i flip the order..i'm not able to get ALL of the table field results.. quite frustrating that is.

here's my query.

Code:
sSQL = "SELECT id, foto, fotourl , fotoalt, link1, link2,link1txt, link2txt, titel, txt FROM nieuwsbriefartikels WHERE p_id = '" & doc_id & "' AND actief='1' AND status='online' ORDER BY rank DESC"
	
	set oRs = oConn.Execute( sSQL )


and getting the results, i just do a simple

Code:
response.write(oRs("titel"))


etc


edit: maybe i should state, that with the query posted here. i don't get the link2 & link2txt results


thanx!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Asp & sql -- problem:order of table fields in query


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap