Ver Mensaje Individual
  #9 (permalink)  
Antiguo 27/05/2009, 12:28
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 3 meses
Puntos: 126
Respuesta: Evitar duplicidad

Hola

Prueba así, usando trasiciones

Código asp:
Ver original
  1. conn.BeginTrans
  2.  
  3. sql1 = "INSERT INTO ficha_vehicular (codfic,vehicu,gralic) VALUES (" & codfic & ","& vehiculo &"," & licencia &")"
  4. conn.Execute(sql1)
  5. if Err.number <> 0 Then
  6. Response.Clear ()
  7. conn.RollBackTrans
  8. Err.Clear ()
  9. Response.End ()
  10. end if
  11.  
  12. sql2 = "INSERT INTO ficha_vivienda (codfic,tipvivi) VALUES (" & codfic & ","& vivienda &")"
  13. conn.Execute(sql2)
  14. if Err.number <> 0 Then
  15. Response.Clear ()
  16. conn.RollBackTrans
  17. Err.Clear ()
  18. Response.End ()
  19. end if
  20.  
  21. conn.CommitTrans
Suerte
__________________
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;" />