![]() |
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.] :confused::confused::confused: Muchas gracias por su ayuda. |
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; |
La franja horaria es GMT +2. Ahora son las 12:53:40. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi