DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   display all the records in table in SQL using VBScript in ASP (http://www.daniweb.com/forums/thread148682.html)

RahulV Oct 2nd, 2008 7:58 am
display all the records in table in SQL using VBScript in ASP
 
--URGENT--
Ive written a code in VBScript in ASP where back end is SQL. Here I want to display all the records with the data of the selected field of the table "Users" but it displays only the first record repetitively for the total number of records in the table times.

<html>
<body>

<%
dim con, rec, str, id, name, passwd
str="select * from users"

set con=createObject("ADODB.Connection")
con.Open "Provider=SQLOLEDB.1;Data Source=.;Initial Catalog=ComputerWorkshop","sa",""

set rec=CreateObject("ADODB.Recordset")
rec.Open str, con

id=rec("biID")
name=rec("vUserName")
passwd=rec("vPassword")

Response.write "biID : vUserName : vPassword "
Response.write "<hr>"

do until rec.EOF
Response.write id & " : " & name & " : " & passwd
response.write "<br>"
rec.MoveNext
loop

rec.close
con.close
%>

</body>
</html>

Please help me to display all the records with the selected fields data of the table.
Thank you in advance.


All times are GMT -4. The time now is 10:10 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC