
23/08/2009, 18:26
|
| | Fecha de Ingreso: agosto-2009
Mensajes: 19
Antigüedad: 15 años, 8 meses Puntos: 0 | |
Como pasar un registro a otra tabla usando getrows usando insert into SOY PRINCIPIANTE AFICIONADO AL VB Y COMO HE LEIDO QUE ES POSIBLE PASAR UN REGISTRO UTILIZANDO GETROWS LO HICE DEL SIGUIENTE MODO:
Dim rstEmployees As Recordset
Dim varrecords As Variant
Dim intNumReturned As Integer
Dim intnumcolumns As Integer
Dim intcolumn As Integer, introw As Integer
Set dbs = OpenDatabase("Neptuno.mdb")
Set rstEmployees = dbs.OpenRecordset _
("SELECT Nombre, Apellidos, Cargo " _
& "FROM Empleados", dbOpenSnapshot)
varrecords = rstEmployees.GetRows(1)
HASTA AQUI SE SUPONE QUE varrecords contiene una matriz con una fila y 3 columnas, lo cual comprobado ejecutando con instrucciones y suponiendo valores como xx=varrecords(0,0)
PERO AL TRATAR DE INSERTAR ESTA MATRIZ USANDO LO SIGUIENTE:
dbs.Execute " INSERT INTO CREADACONMATRIX (Nombre, Apellidos, CANTIDAD) VALUES (varrecords(0, 0), varrecords(1, 0), varrecords(2, 0));"
rstEmployees.Close
dbs.Close
NO RECONOCE A varrecords como matriz y me dice que la funcion varrecords no esta definida...........estoy usando VB5 Y TAL PARECE QUE NO ME PERMITE INTRODUCIR VALORES VALUE TIPO MATRIZ O NO SE QUE PASA.. AGRADEZCO SUS RESPUESTAS. |