View Single Post
  #6  
Old 05/12/2006
Paoti's Avatar
Paoti Paoti is offline
Miembro
 
Join Date: May 2003
Location: Monterrey. N.L., México
Posts: 612
Rep Power: 24
Paoti Va por buen camino
axcel, haz de cuenta que tienes esto:

Articulos.db
ID_articulo
Nombre
Existencia


Ventas.
ID_VENtA
id_articulo
fecha_venta
cantidad



cuando hagas un post, haces esto supongo(agregando que actualize la existencia)



Código Delphi [-]
// tagregamos el detalle de venta.
tventas.insert;
tventas.fieldbyname('id_articulo').asinteger := varID_ARticulos;
tventas.fieldbyname('fecha_Venta').asdatetime := Date;
tevntas.post
// actualizamos el inventario
Tarti.close;
tarti.indexname := 'ixArticulo' // debemso de tener un indice por el campo id_articulo;
tarti.open;
tarti.gotokey 
tarti.fieldbyname('id_articulo').asinteger := varID_ARticulos;
tarti.gotonearest;  // <---- ve en la ayuda de Delphi gotonearest
// aqui encontro el id articulo, entonces hay que modificar la existencia


espero haberte dado una lijera ayuda.


busca en al ayuda de delphi gotonearest


tambien peudes hacer una consulta (TQuery)


P.S. GENIAL QUE VAS EMPEZANDO, PARADO ES BUENO PARA EMPEZAR PERO PARA HACER SISTEMAS TE RECOMENDRIA FIREBIRD, CLARO PARADOX TIENE LO SUYO, SE PUEDE HACER.



P.S. Bienvenido a club Delphi.


P.S. usa el buscador para checar el histórico, posiblemente ya haya alguien tenido tus misms dudas
__________________
Estudia y anda en la calle.... que asi serás el doble de listo que los demás...

análisis de información
análisis y diseño de sistemas

Paoti Rios Reséndiz
Reply With Quote