Ver Mensaje Individual
  #2  
Antiguo 28-03-2007
Avatar de vroa74
vroa74 vroa74 is offline
Miembro
 
Registrado: jul 2006
Posts: 254
Reputación: 18
vroa74 Va por buen camino
Post

ya solucione mi problema.

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').AsString := template.Tnombres; mio.FieldByName('apaterno').AsString := template.Tapaterno; mio.FieldByName('amaterno').AsString := template.Tamaterno; mio.FieldByName('fecha').AsDateTime:= template.Tfecha; mio.FieldByName('direccion').AsString := template.Tdireccion; mio.FieldByName('depto').AsString := template.Tdepto; mio.FieldByName('cp').AsInteger := template.TCP; mio.FieldByName('colonia').AsString := template.Tcolonia; mio.FieldByName('nempleado').AsInteger := template.Tnempleado; //****************************************************** mio.post(); // get the ID of enrolled template. id := mio.FieldByName('ID').AsInteger; tptStream.Free(); mio.Close(); mio.Free(); ag_ejemplo := id; end;
Responder Con Cita