Ver Mensaje Individual
  #1  
Antiguo 27-03-2007
Avatar de vroa74
vroa74 vroa74 is offline
Miembro
 
Registrado: jul 2006
Posts: 254
Reputación: 18
vroa74 Va por buen camino
Question insercion en ado

Hola:
estoy modificando un codigo que me dieron, solo que no tengo la menor idea de que hacer con este codigo.
Para entrar mas en tema le comento.
no se como hace la insecion de los datos y la verdad no tengo idea.
debo insertar datos [integer,string,date,memo,time.]

Código Delphi [-]
function miDB.ag_ejemplo(ejemplo: TTejemplo): Integer;
var
  mio: TADODataSet;
  tptStream: TMemoryStream;
  id: Integer;
begin
  // get DB data and append one row
  mio := TADODataSet.Create(nil);
  mio.Connection := connection;
  mio.CursorType := ctStatic;
  mio.LockType := ltOptimistic;
  mio.CommandText := 'SELECT * FROM MyData';
  mio.Open();
  mio.Append();
  tptStream := TMemoryStream.Create();
  tptStream.write(template.tpt^, template.size);

  (mio.FieldByName('template') as  TBlobField).LoadFromStream(tptStream);
//******************************************************
(mio.FieldByName('nombres') as  Tstring).????????????????????????????
(mio.FieldByName('apaterno') as  Tstring).????????????????????????????
(mio.FieldByName('amaterno') as  Tstring).????????????????????????????
(mio.FieldByName('fecha') as  Tdate).????????????????????????????
(mio.FieldByName('cp.') as  Tinteger).????????????????????????????
(mio.FieldByName('id_control') as  Tinteger).????????????????????????????
(mio.FieldByName('nombres') as  Tstring).????????????????????????????
//******************************************************
  mio.post();
  // get the ID of enrolled template.
  id := mio.FieldByName('ID').AsInteger;

  tptStream.Free();
  mio.Close();
  mio.Free();
  ag_ejemplo := id;
end;

Muchas gracias por su ayuda.
Responder Con Cita