Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2007, 09:32 AM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Display records in a table

Hi Guys, I am racking my brains on this script which does'nt seem to work. Says expected loop!

<%@ Language=VBScript%>
<html>
<head>
<title>Display all Records</title>
</head>
<body>
<Script language="VBScript">

    Set MyConn = CreateObject("ADODB.Connection")
    MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=P:\AT Team\Website\FPMCR.mdb"
    strSQL = "Select * from Reviewer;"
    SET oRs = Execute(strSQL) 'Execute the SQL statement
    DO WHILE NOT oRs.EOF
    on error resume next
</Script>
</pre>
<table>
    <tr>
        <td>
            <tr>
                <td width="100%">Reviewer Name: <% oRs.Fields("Name") %></td>
            </tr>
        </td>
        <td width="65%">&nbsp; <% oRs.Fields("Level") %></td>
    </tr>
</table>
<Script language="VBScript">
    oRs.MoveNext
    Loop
    MyConn.Close
    SET MyConn = Nothing
</Script>
</body>
</html>
 
Old September 21st, 2007, 12:04 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Do While requires a closing Loop
You do have a Loop, but it is in a different script block. I’m pretty sure that you cannot do that.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Horizontal Records display doosti Classic ASP Databases 6 November 15th, 2004 01:07 AM
can't display records from Access Table. jenjenyan Classic ASP Databases 1 April 16th, 2004 02:49 AM
copy and append records from table-A to table B bhunter Access 6 March 9th, 2004 02:02 PM
thousands records enter one table to another table mateenmohd SQL Server 2000 3 July 17th, 2003 07:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.