Dicas Para Melhorar Performace em códigos ASP
Olá Pessoal,
na busca por melhorias em códigos ASP, existe algum diferença em abrir uma conexão por "ObjRs.Open Sql, Conexao" ou por "Set ObjRs = Conexao.Execute(ComandoSQL)"?
Exemplo 1 do codigo
Set Conexao = Server.CreateObject("ADODB.Connection")
Conexao.Open Application("Conexao")
Set ObjRs = Server.CreateObject("ADODB.Recordset")
ObjRs.CursorLocation = 3
ObjRs.CursorType = 0
ObjRs.LockType = 1
Sql = "SELECT id,nome FROM clientes WHERE id =" &Request("id")
ObjRs.Open Sql, Conexao
If Not ObjRs.Eof Then
nome = ObjRs("nome")
id = ObjRs("id")
End If
ObjRs.Close
Set ObjRs = Nothing
Exemplo 2 do codigo
Set ObjRs = Server.CreateObject("ADODB.Recordset")
ObjRs.CursorLocation = 3
ObjRs.CursorType = 0
ObjRs.LockType = 1
Sql = "SELECT id,nome FROM clientes WHERE id =" &Request("id")
Set ObjRs = Conexao.Execute(Sql )
If Not ObjRs.Eof Then
nome = ObjRs("nome")
id = ObjRs("id")
End If
ObjRs.Close
Set ObjRs = Nothing
quais seriam dicas boas para melhorar a performace em páginas com código ASP?
Discussão (5)
Carregando comentários...