Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 23-02-2008
schaka schaka is offline
Miembro
 
Registrado: feb 2008
Posts: 30
Poder: 0
schaka Va por buen camino
Insertar Datos De Un Dbgrid A Una Tabla

HOLA QUE TAL , BUENO SOY NUEVO EN DELPHI , TENGO UN PROBLEMA , TENGO UN DBGRID DONDE MUESTRO LA INFORMACION DE UNA TABLA, Y DESPUES DE REALIZAR UNA BUSQUEDA ME GUSTARIA QUE LA FILA QUE FUE SELECCIONADA COMO RECULTADO DE LA BUSQUEDA `PODER INSERTARLA EN UNA TABLA EN MYSQL, EL PROBLEMA QUE TENGO , ES QUE NO SE COMO RECUPERAR LA INFORMACION DE LA FILA SELECCIONADA DESPUES DE MI BUSQUEDA PARA PODER INSERTARLA EN UNA TABLA , HE DADO UN VISTAZO POR LA INTERNET, Y NO HE PODIDO ENCONTRAR ALGO AL RESPECTO, ESPERO ALGUIEN ME PUEDA AYUDAR .. MUCHISIMAS GRACIAS, MUESTRO MI CODIGO PARA LA BUSQUEDA,

Código Delphi [-]

procedure TFMain.Edit1Change(Sender: TObject);
var i:integer;
palabras: TStringList;
consulta: String;

begin if Edit1.Text = '' then begin consulta:='Select * from productos';
ZQuery.close;
ZQuery.sql.clear;
ZQuery.sql.add(consulta);
ZQuery.open;
end else begin
palabras := TStringList.Create;
palabras.CommaText := Edit1.Text;
ZQuery.close; ZQuery.sql.clear;
for i:=0 to palabras.Count-1 do
begin consulta:=consulta+'and Producto like "%'+palabras.Strings[i]+'%"';
end;
Delete(consulta,1,3);
consulta:='Select * from productos where'+consulta;
ZQuery.SQL.Add(consulta);
ZQuery.Open;
end;//else
end;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
insertar datos en una tabla Alkazar C++ Builder 3 13-11-2007 14:12:00
Como insertar datos a una tabla con un SP Tauro78 Firebird e Interbase 1 31-01-2007 22:46:13
Dbgrid para insertar en una tabla pero cogiendo datos de otra tabla taru MySQL 1 27-07-2006 15:36:12
insertar en tabla las lineas que seleccione el usuario desde un dbgrid arpegius25 Conexión con bases de datos 3 09-05-2006 10:08:59
Como insertar datos de una tabla en otra tabla? Salomon Firebird e Interbase 1 28-08-2003 11:29:40


La franja horaria es GMT +2. Ahora son las 10:58:26.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi