Re: Access +delphi


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]

Posted by WAllison on December 22, 2002 at 14:31:01:

In Reply to: Access +delphi posted by Ste D on December 19, 2002 at 14:06:19:

: hey any spot anything wrong with this code:=??? wenever i add to my access tables three of the items are on 1 line the other on the one above and as you probably relise this messes up for other entries PLEASE HELP!!!heres the code any imput would be appriated :)

: procedure TFormAddAppointment.SpeedButton1Click(Sender: TObject);
: begin
: with Datamodule1.AppointmentsAdoTable do
: begin
: open;
: append;
: //make chosen fields text that of chosen object
: FieldValues['Date']:=DateToStr(DatePicker.date);
: FieldValues['InstructorID']:=InstructorID.Text;
: FieldValues['LearnerID']:=LearnerID.text;
: FieldValues['time']:=DBRadioGroup1.value;
: //refresh table
: Post;
: messagedlg('Appointment Sucessfully Added', mtinformation, [mbOK],0);
: end;
: end;

If not TableName.Open Then TableName.Open;
TableName.Append; // or: TableName.Insert
TableName.FieldByName('FieldName').AsString/integer etc := 'Value';
TableName.Post;

Related Articles and Replies:


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]