Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/08/2008, 13:57
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 4 meses
Puntos: 126
Transiciones en 2 bd

Hola

Intento hacer transiciones con dos bd, pero no se como hacer el BeginTrans, Roll BackTrans, ni CommitTrans

Código PHP:
conn1.BeginTrans

SQL
="UPDATE Tabla1 ..... (BD1)
conn1.Execute(SQL)
if Err.number <> 0 Then
Response.Clear ()
conn1.RollBackTrans
Err.Clear ()
Response.End ()

else ' no hay error

SQL="
INSERT INTO Tabla2 .... (BD1)
conn1.Execute(SQL)
if 
Err.number <> 0 Then
Response
.Clear ()
conn1.RollBackTrans
Err
.Clear ()
Response.End ()

else 
' no hay error

SQL="INSERT INTO Tabla1 .... (BD2)
conn2.Execute(SQL)
if Err.number <> 0 Then
Response.Clear ()
conn2.RollBackTrans
Err.Clear ()
Response.End ()

else ' 
no hay error

conn1
.CommitTrans

end 
if
end if
end if 
Gracias
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />