VBA ACCESS: Daño al contenido cuando exporta por SQL
Uso el siguiente código:
DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[CODIGO_CUC] = '" & Me.txtCodigoCUC.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[FOTO_FORMATO] = '" & Me.lstFormato.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[OBSERVACIONES] = '" & Me.txtObs.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[ORIGEN_ENBLANCO] = '" & Me.chkOrigen_Enblanco.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[ORIGEN_PAIS] = '" & Me.lstOrigen_Pa.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[ORIGEN_PROVINCIA] = '" & Me.lstOrigen_Pro.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[ORIGEN_CIUDAD] = '" & Me.lstOrigen_Ciu.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[ORIGEN_ENTIDAD] = '" & Me.lstOrigen_Ent.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[TIPO] = '" & Me.lstTipo.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[UBICACION_ALBUM] = '" & Me.txtUbica_Album.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[UBICACION_PAGINA] = '" & Me.txtUbica_Pag.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[CANJE] = '" & Me.chkCanje.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[CANJE_CANTIDAD] = '" & Me.txtCanjeCant.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[ESTADO] = '" & Me.M_ESTADO.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[PERIODO] = '" & Me.M_PERIODO.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[PERIODO_INICIO] = '" & Me.txtPerIni.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[PERIODO_FIN] = '" & Me.txtPerFin.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[ANO_SINANO] = '" & Me.chkNoAno.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[ANO] = '" & Me.txtAno.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & "" DoCmd.RunSQL "UPDATE [tabCalendarios] SET [tabCalendarios].[REVISION] = '" & Me.chkRevision.Value & "' WHERE [tabCalendarios].[ID] = " & Me.txtID.Value & ""
en ocasiones se daña el contenido y se llena de caracteres asiáticos (chino). No puedo eliminar el registro, no lo puedo editar... No sé qué hacer. Intento unificar todo eso en un único llamado pero me devuelve error y no encuentro dónde meto mal una coma o una comilla, por ello no he podido probar si el error se produce justamente por manipular tantas veces un mismo registro a la vez.