Borrar Registro mdb

HMG en Español

Moderator: Rathinagiri

Post Reply
AidTIC
Posts: 63
Joined: Mon Apr 22, 2013 8:29 am
Been thanked: 2 times

Borrar Registro mdb

Post by AidTIC » Wed Nov 29, 2017 11:37 pm

No consigo poder borrar ciertos registros de una tabla de access.

---------------------------
Error SDDODBC/1903 HY000 Unable to get error message: DELETE FROM Table1 WHERE CUTTED = '1' (DOS Error 9999)

Called from DBUSEAREA(0)
Called from MAIN(70)

Code: Select all

aFichAcc := "DBQ="+ALLTRIM(cLOCDBS)+";Driver={Microsoft Access Driver (*.mdb)}"
	Connect ( )
	
	RDDSETDEFAULT( "SQLMIX" )
	IF (conn1 := RDDINFO( RDDI_CONNECT, { "ODBC", aFichAcc } )) == 1	
           inst := "DELETE FROM Table1 WHERE CUTTED = '1' "
	   DBUSEAREA( .T.,, inst , "aTablet" ,.f.,,,conn1)
	  
	   Close aTablet
	ELSE
	    MSGINFO ("No he Podido Conectar con " + aFichAcc , "Error de Connexion" )
		ThisWindow.Release
	EndIF
Image
Attachments
Captura.PNG
Captura.PNG (19.77 KiB) Viewed 270 times

User avatar
luisvasquezcl
Posts: 1070
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 12 times
Been thanked: 14 times
Contact:

Post by luisvasquezcl » Wed Nov 29, 2017 11:47 pm

Si el campo cutted es caracter la sentrncia estaria bien sino quitale las comillas simples.
Espero te ayude

AidTIC
Posts: 63
Joined: Mon Apr 22, 2013 8:29 am
Been thanked: 2 times

Post by AidTIC » Wed Nov 29, 2017 11:59 pm

es numérico, pero quitandolas, me da el mismo error.

User avatar
luisvasquezcl
Posts: 1070
Joined: Thu Jul 31, 2008 3:23 am
Location: Chile
Has thanked: 12 times
Been thanked: 14 times
Contact:

Post by luisvasquezcl » Thu Nov 30, 2017 2:49 am

El comando estaria bien, si le quitaste las comillas simples y el nombre de la tabla y campo es correcto es problema del rdd.
El comando debe quedar como
"delete from table1 where cutted =1"
Verifica si el dbusearea esta correctamente construido.
Asi vamos descartando posibilidadea.

User avatar
mustafa
Posts: 633
Joined: Fri Mar 20, 2009 11:38 am
Location: Alicante - Spain
Been thanked: 54 times

Post by mustafa » Thu Nov 30, 2017 12:56 pm

Hola AidTIC
Mírate el Post
http://www.hmgforum.com/viewtopic.php?f ... 207#p45207

Mira ---> Function Eliminar()
Haber si te puede servir

Saludos
Mustafa

Post Reply