Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

 
 
Herramientas Buscar en Tema Desplegado
  #12  
Antiguo 12-03-2010
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 28
Caral Va por buen camino
Hola
Recuerda que en tu caso prácticamente todo se repite y que lo que necesitas modificar es solamente el string del SQL, osea, tienes muchas alternativas.
Otra, mas reducida:
Código Delphi [-]
procedure TForm3.BitBtn4Click(Sender: TObject);
var Texto1, Texto2: String;
begin
 Texto1:= 'select NOMBRES,MATRICULA,CLAVE,';
 Texto2:= 'from 20092 where clave = '+quotedstr(combobox1.Text)+' order by nombres asc';
 with datam.Query1 do begin;
 close;
 sql.Clear;

try
if radioButton1.Checked = true then
begin
sql.Text:= Texto1+'A1'+Texto2;
end;

if radioButton2.Checked = true then
begin
sql.Text:= Texto1+'A2'+Texto2;
end;

if radioButton3.Checked = true then
begin
sql.Text:= Texto1+'A3'+Texto2;
end;

if radioButton4.Checked = true then
begin
sql.Text:= Texto1+'A4'+Texto2;
end;

if radioButton5.Checked = true then
begin
sql.Text:= Texto1+'A5'+Texto2;
end;

if radioButton6.Checked = true then
begin
sql.Text:= Texto1+'A6'+Texto2;
end;

if radioButton7.Checked = true then
begin
sql.Text:= Texto1+'A7'+Texto2;
end;

if radioButton8.Checked = true then
begin
sql.Text:= Texto1+'A8'+Texto2;
end;

if radioButton9.Checked = true then
begin
sql.Text:= Texto1+'A9'+Texto2;
end;

if radioButton10.Checked = true then
begin
sql.Text:= Texto1+'A10'+Texto2;
end;

finally
open;
edit;
end;

end;

end.
Y habrán mas opciones, la idea con esto es solamente que aprendamos a dividir un string.
Saludos
__________________
Siempre Novato
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
Hacer que una columna de un DbGrid aparezca distinta según valor Aprendiendo OOP 11 30-11-2018 14:47:20
error de sql server "Informacion de columna clave insuficiente" jhcaboverde Conexión con bases de datos 1 17-08-2007 19:40:31
Informacion de columna clave insuficiente para realizar la operacion update o refresh Cabanyaler MS SQL Server 11 04-06-2007 13:25:04
informacion de columna clave insuficiente vipernet MS SQL Server 6 07-09-2006 20:26:40
Extraer datos de una pagina en java que tiene clave (sabiendo la clave claro) ;) kalimocho Internet 2 29-06-2005 05:11:24


La franja horaria es GMT +2. Ahora son las 21:07:56.


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