
08/08/2002, 17:23
|
| | Fecha de Ingreso: enero-2002
Mensajes: 189
Antigüedad: 23 años, 3 meses Puntos: 0 | |
Re: necesito solo algun tip de ayuda en esto! continuacion...
'Creando recordset destino con la misma estructura de origen
For intPos = 0 To rstSource.Fields.Count - 1
rstDestino.Fields.Append rstSource.Fields(intPos).Name, rstSource.Fields(intPos).Type, rstSource.Fields(intPos).DefinedSize, rstSource.Fields(intPos).Attributes
Next
'Inicializando valores de paginación de objeto destino
If rstSource.RecordCount > 0 Then
intNumPagTot = rstSource.PageCount
intNumRegTot = rstSource.RecordCount
rstSource.AbsolutePage = intNumPag
intPosicionFinal = intNumReg * intNumPag
End If
'Abriendo recordset para ingreso de datos
rstDestino.Open
'Insertando datos
While Not rstSource.EOF And rstSource.AbsolutePosition <= intPosicionFinal
rstDestino.AddNew
For intPos = 0 To rstDestino.Fields.Count - 1
rstDestino.Fields.Item(intPos).Value = Trim(rstSource.Fields(intPos).Value())
Next
rstDestino.Update
rstSource.MoveNext
Wend
'Asignando recordset
Set execProcedurePage = rstDestino
'Cerrando conexión
Set cmd.ActiveConnection = Nothing
rstSource.Close
'Destruyendo objetos
Set rstSource = Nothing
Set rstDestino = Nothing
Set cmd = Nothing
'Liberando recursos
ctx.SetComplete
'Finalizando funcion
Exit Function
Exception:
'Destruyendo objetos
Set rstSource = Nothing
Set rstDestino = Nothing
Set cmd = Nothing
'liberando recursos
ctx.SetAbort
'Lanzando error
Err.Raise Err.Number, Err.Source, Err.Description
End Function |