
<%
Dim rsFact, sqlFact
Dim rsFact_numRows
Set rsFact = Server.CreateObject("ADODB.Recordset")
rsFact.ActiveConnection = MM_ConFactura_STRING
rsFact.Source = "SELECT * FROM dbo.Factura WHERE Bandera='" & 0 & "'"
rsFact.CursorType = 0
rsFact.CursorLocation = 2
rsFact.LockType = 1
rsFact.Open()
rsFact_numRows = 0
%>
<%
Dim cmdUpDate, sqlUp
Set cmdUpDate = Server.CreateObject("ADODB.Command")
Dim rsCMKArt
Dim rsCMKArt_numRows
Set rsCMKArt = Server.CreateObject("ADODB.Recordset")
dim vardesc
While (NOT rsFact.EOF) %>
<%
vardesc= rsFact("Descripcion")
rsCMKArt.ActiveConnection = MM_ConD84_STRING
rsCMKArt.Source = "SELECT * FROM dbo.Articulos Where Descripcion = '" & vardesc & "'"
rsCMKArt.CursorType = 0
rsCMKArt.CursorLocation = 2
rsCMKArt.LockType = 1
rsCMKArt.Open()
rsCMKArt_numRows = 0
response.Write(rsCMKArt("Clave"))
sqlUp = "UPDATE Factura Set ClaveArtCMK= ' " & rsCMKArt("Clave") &" ' Where Articulo=' " & rsFact("Articulo") & " ' "
Set cmdUpDate = Server.CreateObject("ADODB.Command")
cmdUpDate.ActiveConnection = MM_ConFactura_STRING
cmdUpdate.CommandType = 1
cmdUpDate.CommandText = sqlUp
cmdUpDate.Execute
%>
<%
rsCMKArt.MoveNext()
' rsCMKArt.Close
rsFact.MoveNext()
Wend
%>