urgenteeee
Publicado por Jonathan (85 intervenciones) el 17/05/2007 07:42:31
Hola! quiero hacer que cuando un pedido no exista en una tabla pero si en la otra, que me inserte unos campos d ese registro pero me da error y no se como se hace el insert. Me podeis ayudar?? Os dejo el codigo:
chiv = False
While Not rs.EOF
While Not rs2.NoMatch And chiv = False
If ((rs.Fields("pedido") = rs2.Fields("pedido")) And (rs.Fields("Z") = rs2.Fields("Z"))) Then
chiv = True
end if
If chiv = False Then rs2.MoveNext
Wend
If chiv = False Then
db.Execute ("INSERT INTO pedidos([NOMBRE CLIENTE])= rs2.Fields('NOMBRE CLIENTE')")
end if
chiv = False
rs.MoveNext
Wend
Gracias
chiv = False
While Not rs.EOF
While Not rs2.NoMatch And chiv = False
If ((rs.Fields("pedido") = rs2.Fields("pedido")) And (rs.Fields("Z") = rs2.Fields("Z"))) Then
chiv = True
end if
If chiv = False Then rs2.MoveNext
Wend
If chiv = False Then
db.Execute ("INSERT INTO pedidos([NOMBRE CLIENTE])= rs2.Fields('NOMBRE CLIENTE')")
end if
chiv = False
rs.MoveNext
Wend
Gracias
Valora esta pregunta
0