Clipper/FiveWin - pregunta

 
Vista:

pregunta

Publicado por ruben francisco muciño (14 intervenciones) el 20/02/2007 00:08:05
POR QUE SI CREO UNA TABLA EN UNA BASE DE DATOS LLAMEMOSLE CATALOGOS Y UNA TABLA TIENDAS CON LOS CAMPOS:

ID : INT 4
CLAVE :VARCHAR(10)
NOMBRE :VARCHAR(50)

TODO ESTO USANDO xHarbour y MySQL.

CUANDO INSERTO VALORES O LOS MODIFICO EN LA TABLA.

LOS CAMPOS QUE SON VARCHAR SIEMPRE SE RECORREN UN CARACTER.

POR EJEMPLO:

CCLAVE :="0123AAAQ"
CNOMBRE :="TIENDA DE ABARROTES"

oSql:CommandText:="insert into tiendas(clave,nombre) VALUES (' "+CCLAVE+" ',' "+CNOMBRE+" ');"
oSql:Execute()

DESPUES DE EJECUTAR ESTAS INSTRUCCIONES Y REVISAR LO QUE SE GUARDO EN LA TABLA TIENDAS EL RESULTADO ES:

CLAVE :=" 0123AAAQ"
NOMBRE :=" TIENDA DE ABARROTES"
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:pregunta

Publicado por Gabriel Pascual (913 intervenciones) el 20/02/2007 01:20:48
Prueba haciendo un ALLTRIM() a cClave y a cNombre antes de ejecutar el query.

Por cierto, ya que estas usando ADO, ¿ no seria mas facil hace esto ?:

oRS:ADDNEW()
oRS:FIELDS('cclave'):Value := "0123AAAQ"
oRS:Fields('cNombre):Value := "TIENDA DE ABARROTES"
oRS:Update()

Te tendria que funcionar igual, pero trabajando directamente sobre el recordset.
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