Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/06/2010, 08:50
tomyorke25
 
Fecha de Ingreso: noviembre-2008
Mensajes: 3
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Commit y Seleccionar texto (en ASP)

Para múltiples transacciones:
Dim Error = "N"
Conn.BeginTran

'Primera transacción:
SQL = "delete ..."
Conn.Execute (SQL)
if Conn.Errors.count > 0 then ' Existe error
Error = "S"
end if

'Segunda transacción:
if Error = "N" then
SQL = "update ..."
Conn.Execute (SQL)
if Conn.Errors.count > 0 then ' Existe error
Error = "S"
end if
end if

'Tercera transacción:
if Error = "N" then
SQL = "insert into ... "
Conn.Execute (SQL)
if Conn.Errors.count > 0 then ' Existe error
Error = "S"
end if
end if

if Error = "S" then
Conn.RollBackTrans
elseif Error = "N" then
Conn.CommitTrans
end if