Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/07/2008, 13:10
Avatar de JJF
JJF
 
Fecha de Ingreso: mayo-2005
Mensajes: 205
Antigüedad: 20 años, 1 mes
Puntos: 0
Sonrisa Controlar si existe un registro

Hola! Tengo este codigo que logré despues de tanto tiempo de intentar e intentar.
Funciona, pero necesito aclarar una duda.

Si envio desde el form 5 registros, y el 3º no existe o es erroneo, cómo lograr que inserte todos los demás y me anuncie luego el que está erróneo o no existe?





Código PHP:

   Dim Conn
,strSQL 
   Dim i
   Set Conn 
Server.CreateObject("ADODB.Connection"

   
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= " Server.MapPath("db/video.mdb"



for 
i0 to cant 1
nvd 
Request.Form("nvd" i)

   
strSQL "Select nvd from VD where nvd = '"&nvd&"'"
   
Set RS1=Conn.Execute(strSQL)
   
if 
RS1("nvd") <>"" then

   strSQL 
"Update VD Set NOM='"&NOM&"', AUT='"&AUT&"', DNI = '"&DNI&"', NUMCL = '"&NUMCL&"', IDC='"&IDC&"', EST = 'Alquilado' Where NVD= '" NVD "'"
   
Conn.Execute(strsql


   
strSQL "insert into MOV (NVD, NOM, DNI, CLA, FH, AUT, NUMCL) values ('" NVD "','" NOM "','" DNI "','" CLA "','" FH "', '" AUT "','" NUMCL "')" 
   
Conn.Execute(strSQL)  

end if
next             

                                                                       
   Conn
.Close 
   set Conn 
nothing 


Muchas gracias de antemano!