[Solved] Delphi XE8 Load PDF File

You don’t need all of the jumping-through hoops you’re doing. Windows will find the application associated with PDF files for you. procedure TForm1.Button1Click(Sender: TObject); var s: String; Ret: DWord; begin s := ‘C:\MyFiles\MyFile.pdf’; Ret := ShellExecute(Handle, nil, PChar(s), nil, nil, SW_SHOW); if Ret < 32 then ShowMessage(SysErrorMessage(GetLastError)); end; Note: Normally you should never call a … Read more

[Solved] Syntax error. in query expression -Delphi

Give a try; Procedure TFNewCarAct.BtnSaveClick(Sender: TObject); begin adoQueryCCA.Close(); adoQueryCCA.SQL.Clear; adoQueryCCA.SQL.Add(‘INSERT INTO tblcaractivity ([CCarID],[Date],[Millage],[SerRcd],[EOType],[EOQunt],[AirFil],[GOil])’); adoQueryCCA.SQL.Add(‘VALUES(:CCarID,:Date,:Millage,:SerRcd,:EOType,:EOQunt,:AirFil,:GOil)’); adoQueryCCA.Parameters.ParamByName(‘CCarID’).Value:= Integer(ComboBox2.Items.Objects[ComboBox2.ItemIndex]); adoQueryCCA.Parameters.ParamByName(‘Date’).Value:= Edit6.Text; adoQueryCCA.Parameters.ParamByName(‘Millage’).Value:= Edit1.Text; adoQueryCCA.Parameters.ParamByName(‘SerRcd’).Value:= memo1.Text; adoQueryCCA.Parameters.ParamByName(‘EOType’).Value:= Edit2.Text; adoQueryCCA.Parameters.ParamByName(‘EOQunt’).Value:= Edit3.Text; adoQueryCCA.Parameters.ParamByName(‘AirFil’).Value:= Edit4.Text; adoQueryCCA.Parameters.ParamByName(‘GOil’).Value:= Edit5.Text; adoQueryCCA.ExecSQL; ShowMessage(‘Done’); end; procedure TFNewCarAct.FromShow(Sender: TObject); begin ADOQueryCT.Open; while Not ADOQueryCT.Eof do begin ComboBox1.Items.Add(ADOQueryCT.FieldByName(‘Name’).AsString); ADOQueryCT.Next; end; ADOQueryCT.Close; if ComboBox1.Items.Count > 0 then ComboBox1.ItemIndex := 0; … Read more