Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/02/2008, 08:13
Avatar de pcarvajal
pcarvajal
 
Fecha de Ingreso: enero-2002
Mensajes: 701
Antigüedad: 23 años, 3 meses
Puntos: 8
Re: Actualizar agregando un nuevo registro

A ver si te entendí bien:

Cita:
<%
id_historial= 341
referencia = "5345345"


Dim oConn, rs, SQL
Dim nombre
'Creo el objeto Connection
set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("bd1.mdb")


'actualizamos el estatus a 1
Sql="UPDATE historia SET estatus = 0, referencia = '" & estatus & "' where id_historial = " & id_historial
oConn.Execute(SQL)
'y generamos un nuevo registro con los mismos datos pero con estatus 1
Sql="INSERT INTO historia "
Sql=Sql & "SELECT id_tipo, 1,referencia WHERE where id_historial = " & id_historial
oConn.Execute(SQL)
Response.Write("SE ACTUALIZO tabla")

oConn.Close

%>
Ojala sea eso, espero te sirva,
Saludos!