display all the records in table in SQL using VBScript in ASP

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2007
Posts: 68
Reputation: RahulV is an unknown quantity at this point 
Solved Threads: 0
RahulV's Avatar
RahulV RahulV is offline Offline
Junior Poster in Training

display all the records in table in SQL using VBScript in ASP

 
0
  #1
Oct 2nd, 2008
--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.

  1. <html>
  2. <body>
  3.  
  4. <%
  5. dim con, rec, str, id, name, passwd
  6. str="select * from users"
  7.  
  8. SET con=createObject("ADODB.Connection")
  9. con.Open "Provider=SQLOLEDB.1;Data Source=.;Initial Catalog=ComputerWorkshop","sa",""
  10.  
  11. SET rec=CreateObject("ADODB.Recordset")
  12. rec.Open str, con
  13.  
  14. id=rec("biID")
  15. name=rec("vUserName")
  16. passwd=rec("vPassword")
  17.  
  18. Response.WRITE "biID : vUserName : vPassword "
  19. Response.WRITE "<hr>"
  20.  
  21. do until rec.EOF
  22. Response.WRITE id & " : " & name & " : " & passwd
  23. response.WRITE "<br>"
  24. rec.MoveNext
  25. loop
  26.  
  27. rec.close
  28. con.close
  29. %>
  30.  
  31. </body>
  32. </html>

Please help me to display all the records with the selected fields data of the table.
Thank you in advance.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MS SQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC