Access - no me añade registros

 
Vista:

no me añade registros

Publicado por Lithium_Flower (56 intervenciones) el 23/06/2006 14:41:34
Tengo el siguiente código que no me añade registros a la tabla, a lo mejor me falta alguna cosa y no me he dado cuenta. Por favor, a ver si alguien me puede ayudar. Gracias

Dim RcstNew As Recordset
Dim BseTemp As Database

Set BseTemp = CurrentDb
Set RcstNew = BseTemp.OpenRecordset("PUBLICACIONES")


SQl1 = "INSERT INTO [PUBLICACIONES](NUM, AUTOR1, AUTOR2, AUTOR3" _
& " , TITULO, PREMIO, CATALOGACION, TEMATICA, LUGAR_EDIC, " _ ANIO_EDIT," _
& " AUTOR_ILUSTR, ISBN, COLABORACION, SALA_EXP, Fecha_Exp,DESCRIPCION," _
& " AUTOR_PROLOGO, DEP_LEGAL)" _
& " VALUES(" & NewNum & ", '" & NewA1 & "', '" _
& NewA2 & "', '" & NewA3 & "', '" & NewTit & "', '" _
& NewPrem & "', '" & NewCat & "', '" & NewTem & "', '" & NewLug & "', '" _
& NewAnio & "', '" & NewIlus & "', '" & NewISBN & "', '" & NewColab & "', '" _
& NewSala & "', '" & NewFecha & "', '" & NewDesc & "', '" & NewProl & "', '" _
& NewDLeg & "');"

BseTemp.Execute SQl1
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:no me añade registros

Publicado por Responder (463 intervenciones) el 23/06/2006 20:55:53
Proba esto que sin la necesidad de abrir la base y la tabla te lo tiene que insertar

docmd.runsql("INSERT INTO [PUBLICACIONES](NUM, AUTOR1, AUTOR2, AUTOR3" _
& " , TITULO, PREMIO, CATALOGACION, TEMATICA, LUGAR_EDIC, " _ ANIO_EDIT," _
& " AUTOR_ILUSTR, ISBN, COLABORACION, SALA_EXP, Fecha_Exp,DESCRIPCION," _
& " AUTOR_PROLOGO, DEP_LEGAL)" _
& " VALUES(" & NewNum & ", '" & NewA1 & "', '" _
& NewA2 & "', '" & NewA3 & "', '" & NewTit & "', '" _
& NewPrem & "', '" & NewCat & "', '" & NewTem & "', '" & NewLug & "', '" _
& NewAnio & "', '" & NewIlus & "', '" & NewISBN & "', '" & NewColab & "', '" _
& NewSala & "', '" & NewFecha & "', '" & NewDesc & "', '" & NewProl & "', '" _
& NewDLeg & "')

Espero que te funcione

Suerte

Rodolfo
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:no me añade registros

Publicado por Lithium_Flower (56 intervenciones) el 26/06/2006 09:21:47
sigue sin añadirme registros, puede ser pq me falte alguna referencia a alguna librería de objetos¿?¿??¿
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:no me añade registros

Publicado por Lithium_Flower (56 intervenciones) el 26/06/2006 10:41:09
me añade cuando relleno todos los campos, pero cuando algun campo lo dejo vacio, no me inserta el registro, y eso que ya tiene un campo clave definido y se lo introduzco por teclado y todo....
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar