Bueno muchachos como soy novato no entiendo cuando me dicen q declare esto
shortdateformat:='yyyy/mm/dd'; en donde lo hago?
Código:
unit Ualta_socio;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ComCtrls,Umodulo;
type
Talta_socios = class(TForm)
id_socio: TLabel;
ingreso: TLabel;
nombre: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
ed_dni: TEdit;
ed_id: TEdit;
ed_nombre: TEdit;
ed_domicilio: TEdit;
ed_telefono: TEdit;
ed_movil: TEdit;
ed_cuota: TEdit;
ed_mail: TEdit;
ed_peso: TEdit;
ed_observaciones: TEdit;
bregistrar: TBitBtn;
bmodificar: TBitBtn;
beliminar: TBitBtn;
bsalir: TBitBtn;
StaticText1: TStaticText;
Label3: TLabel;
Label14: TLabel;
ed_estado: TComboBox;
ed_ingreso: TEdit;
ed_nacimiento: TEdit;
fechaing: TDateTimePicker;
procedure bsalirClick(Sender: TObject);
procedure preparo_altas_socios;
procedure bregistrarClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
alta_socios: Talta_socios;
implementation
{$R *.dfm}
procedure Talta_socios.bsalirClick(Sender: TObject);
begin
close;
end;
procedure talta_socios.preparo_altas_socios;
begin
dm.consulta.Close;
dm.consulta.SQL.Clear;
dm.consulta.SQL.Add('insert into socios values(:id_socio,:ingreso,:nombre,:nacimiento,:dni,:domicilio,:telefono,:movil,:mail,:estado,:peso,:cuota,:observaciones)');
dm.consulta.ParamByName('id_socio').AsInteger:= strtoint(ed_id.Text);
dm.consulta.ParamByName('ingreso').AsString:=DateToStr(fechaing.Date);
dm.consulta.ParamByName('nombre').AsString:=ed_nombre.Text;
dm.consulta.ParamByName('nacimiento').Asstring:='2008/05/29';
dm.consulta.ParamByName('dni').AsInteger:=strtoint(ed_dni.Text);
dm.consulta.ParamByName('domicilio').AsString:=ed_domicilio.Text;
dm.consulta.ParamByName('telefono').AsInteger:=strtoint(ed_telefono.Text);
dm.consulta.ParamByName('movil').AsInteger:=strtoint(ed_movil.Text);
dm.consulta.ParamByName('mail').AsString:=ed_mail.Text;
dm.consulta.ParamByName('estado').AsString:=ed_estado.Text;
dm.consulta.ParamByName('peso').AsString:=ed_peso.Text;
dm.consulta.ParamByName('cuota').AsFloat:=strtofloat(ed_cuota.Text);
dm.consulta.ParamByName('observaciones').AsString:=ed_observaciones.Text;
end;
procedure Talta_socios.bregistrarClick(Sender: TObject);
begin
if application.MessageBox('Se agregara el siguiente registro a la base de datos ¿Esta seguro?','Alerta',MB_ICONEXCLAMATION+MB_OKCANCEL)=MROK
then
begin
preparo_altas_socios;
dm.consulta.ExecSQL;
showmessage('Se guardaron los datos con exito');
ed_id.Text:='';
ed_ingreso.Text:='';
ed_nombre.Text:='';
ed_nacimiento.Text:='';
ed_dni.Text:='';
ed_domicilio.Text:='';
ed_telefono.Text:='';
ed_movil.Text:='';
ed_mail.Text:='';
ed_estado.Text:='';
ed_cuota.Text:='';
ed_observaciones.Text:='';
end
else
alta_socios.ModalResult:=mrnone;
end;
end.
ese es mi codigo entero para la parte de alta de socios por otra parte todo anda ala perfeccion el uncio problema como les digo es la fecha