<%@ Language=JScript %> Um belo exemplo de acesso a uma BD... <% var CS = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=PW;Data Source=localhost"; var myConnection = Server.CreateObject("ADODB.Connection"); myConnection.open(CS); myRecordSet = myConnection.Execute( "select numero,aluno.nome,email,turnoTP "+ "from aluno,turno "+ "where aluno.turnoTP=turno.nome order by aluno.nome" ); %> <% while(!myRecordSet.eof){ %> <% for(Index=0; Index < (myRecordSet.fields.count); Index++) { %> <% } myRecordSet.MoveNext() %> <% } myRecordSet.Close(); myConnection.Close(); %>
<%= myRecordSet(Index) %>