有人可以解释这个ASP code如何工作的? [英] Can somebody explain how this asp code works?

查看:427
本文介绍了有人可以解释这个ASP code如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想回响在我的数据库从表中的一些数据,发现这code:

I wanted to echo some data from a table in my database and found this code:

set rs = Server.CreateObject("ADODB.recordset")

rs.Open "Select name From users", conn

do until rs.EOF
    for each x in rs.Fields
        Response.Write(x.value)
    next
    rs.MoveNext
loop

rs.close

我测试了它和它的工作,但我不知道什么所有的语法手段,也没有提供与code解释。有经验的人能帮助我吗?

I tested it and and it worked but I have no clue what all that syntax means and there is no explanation provided with the code. Can someone with experience help me out?

推荐答案

RS是一个记录,这意味着数据库查询的结果。

rs is a recordset, which means a result of a database query.

通过记录(即表用户)找到的所有行的做,直到...循环遍历(与MoveNext方法的帮助下)。

The do until ... loop iterates (with the help of movenext) through all the rows found in the recordset (i.e. table users).

在所有行中发现的每个...下一个循环通过单列,在这种情况下,只有列名中找到的所有领域。

On all rows found the for each ... next loops through all fields found in the single row, which in this case is only the column name.

这篇关于有人可以解释这个ASP code如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆