| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Database record extraction
<%
sql = "SELECT ID_Pais," & Ucase(idioma) & ",idioma FROM NombrePaises Where Activo=1 ORDER BY " & Ucase(idioma) & " ASC" set rdo = conex.Execute(sql) %> <% while not rdo.EOF %> <%=rdo(1)%><br> <%rdo.MoveNext %> <% wend %> Please could someone explain exactly what this code does, I am getting a little lost as to what the 1 indicates in : <%=rdo(1)%> |
|
#2
|
||||
|
||||
|
__________________
selwonk If I've posted some code above, you might think it looks a bit simplistic. It might be. I'd rather people tried the next step themselves rather than getting a full solution on a plate. That way they learn more!
|
|
#3
|
|||
|
|||
|
Hi.
Here rdo is ur recordset. Once data is fetched from db and its in ur recordset, u can access the columns through 2 ways. By using the column index or by supllying the column name. In the code u are using rdo(1), means that access the value from the colums that appears at index number 1 in the query. index may start from 0 representing ist column in the query or it might start from 1 representing ist column in the query. so here <%=rdo(1)%><br> is displaying the value of ist column at each iteration if index starts at 1, otherwise if index starts at 0 then its displaying the value of second column in the query. regards Quote:
|
|
#4
|
|||
|
|||
|
Hi.
Here rdo is ur recordset. Once data is fetched from db and its in ur recordset, u can access the columns through 2 ways. By using the column index or by supllying the column name. In the code u are using rdo(1), means that access the value from the colums that appears at index number 1 in the query. index may start from 0 representing ist column in the query or it might start from 1 representing ist column in the query. so here <%=rdo(1)%><br> is displaying the value of ist column at each iteration if index starts at 1, otherwise if index starts at 0 then its displaying the value of second column in the query. regards |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Database record extraction |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|