navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

SQL Query using ADO connection

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> SQL Query using ADO connection
Page: [1]
 
JohnH

 

Posts: 43
Joined: 12/1/2004
Status: offline

 
SQL Query using ADO connection - 4/23/2008 10:53:46   
This is probably a really easy one (I am hoping!)

Can someone tell me why my SQL query is only returning the first record? I have 85 rows of data in the table.

<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=xxx;UID=xxx;PWD=xxx;DATABASE=xxx"

Set rs = Server.CreateObject("ADODB.Recordset")
SQL = "select * from trans"
rs.open SQL, conn

response.write rs("REQ_ID")

rs.close
conn.close
Set rs = Nothing
Set conn = Nothing
%>


Thanks John
rdouglass

 

Posts: 9137
From: Biddeford, ME USA
Status: offline

 
RE: SQL Query using ADO connection - 4/23/2008 11:18:02   
There isn't a loop in there. Try something like this:

...
rs.open SQL, conn

do while NOT rs.EOF
response.write rs("REQ_ID")
rs.MoveNext
loop

rs.close
...


See what I did?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to JohnH)
JohnH

 

Posts: 43
Joined: 12/1/2004
Status: offline

 
RE: SQL Query using ADO connection - 4/25/2008 6:37:37   
Thanks rdouglas.

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> SQL Query using ADO connection
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts