CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 not update value...

Print topic Send  topic

Author Message
miltonpt80

Posts: 1
Posted: 11/02/2007, 8:07 AM

not update senha. why?
myRecordSet is bad?
...


<%@ language="javascript"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">

<%

var user = "peter@gmail.com";
var pass = "merda";
var CS = "Provider=SQLOLEDB.1;Server=FT\\SQLEXPRESS;Database=PW;Uid=sa;Pwd=peter";
var myConnection = Server.CreateObject("ADODB.Connection");
myConnection.open(CS);

var strSQL = "select numero from aluno where email='" + user + "'";
myRecordSet = myConnection.Execute(strSQL);
if (!myRecordSet.eof){ // aluno existe
var numero = myRecordSet(0); // sacar o numero
Response.Write("Numero aluno=" + numero);
Response.Write("<br />");

strSQL = "select senha from aluno where numero=" + numero;
myRecordSet = myConnection.Execute(strSQL); // sacar a senha
var senha = myRecordSet(0); // sacar a senha
//myConnection.Properties.Item("senha");

Response.Write("Senha='" + senha + "'");
Response.Write("<br />");
Response.Write("Pass='" + pass + "'");
Response.Write("<br />");

if (senha==null) { //verificar se o aluno tem senha
Response.Write("Aluno sem senha");
strSQL = "update aluno set senha='" + pass + "' where numero=" + numero; //AFECTA rows senha!!

//UPDATE aluno SET senha = 'buraco' WHERE numero = 30543
myRecordSet = myConnection.Execute(strSQL);
Response.Write("Senha criada");

} else { // com senha
if (pass == senha){
Response.Write("Senha valida");
} else {
Response.Write("Senha não é valida");
}
}
}
else
{
Response.Write("Aluno nao existe!!");
}

myRecordSet.Close();
myConnection.Close();
%>



:-O
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.