Jump to content

Henry Olive

Members
  • Content Count

    324
  • Joined

  • Last visited

Everything posted by Henry Olive

  1. Henry Olive

    Getting Excel Column Value

    Good Day, Night ..... ItemNoCol := Ord(ComboBox2.Text[1]) - Ord('A') + 1; QtyCol := Ord(ComboBox3.Text[1]) - Ord('A') + 1; DataStart := StrToInt(ComboBox4.Text); // Which column does data start in for Row := DataStart to ExcelRowsCount do begin ItemNo :=Trim(Sheet.Cells[Row, ItemNoCol]); if (ItemNo <>'') then if (Sheet.Cells [Row, QtyCol] <> '0') or (Sheet.Cells [Row, QtyCol] <> '') then // HERE i get invalid variant operation err.msg begin .... end; What am i doing wrong ? Thank You
  2. Henry Olive

    Parameter

    Good Day In Stored Procedure i can use below code WHERE :CUSTNO IS NULL OR C.CUSTNO=:CUSTNO) How can i use above code inside Delphi (10,4) ? SqlText := 'SELECT CUSTNO, CUSTNAME,EMAIL FROM CUSTOMER WHERE CUSTNO = :CUSTNO'; CDS1.CommandText := SqlText; CDS1.Params[0].asString = ?? // If :CUSTNO = '' (Empty) then show all Customers else just show choosen Customer Thank You
  3. Henry Olive

    Parameter

    Thank you Angus I dont want to use S.Proc. as i wrote my prior message i know how to use params in S.Proc but i want to use a dataset, query component inside Delphi
  4. Henry Olive

    ClientDataSet Wrong Aggregate

    Good Day Delphi 10,4 Table Field Values : (F1 = 95.615,79 , F2 = 6) In Firebird SQL i make a calculation like ( F1 * F2 ) as TOTAL and in my query result (In Delphi) = 573.694,74 which is correct I have an Aggregate Field in my CDS and it's Expression = SUM(TOTAL) In my table there is just 1 record and the Aggregate result = 573.694,73 What am i doing wrong ? Thank You
  5. Henry Olive

    ClientDataSet Wrong Aggregate

    Thank you Olli73, Happy New Year Both Qty & Price fields are TFMTBCDField; Select Sum(Round(Price * Qty, 2)) as Total gives correct result
  6. Henry Olive

    ClientDataSet Wrong Aggregate

    Thank you Serge, Happy new year Price : Numeric(15,5) Qty : Numeric(15,2) Firebird,: Select Sum(Price * Qty) as Total (the result = 573.694,74 ) In Delphi I Created an Aggr.Field and its Expression is Sum(Total) (the result = 573.694,73 ) Thank You
  7. Henry Olive

    DBGrid PickList Change

    Good Day I have a DataSource and DBGrid in a Form (The other database comp. are in Data Module) In the DBGrid's first field's PickList has some items I need to catch dbgrid's first field Change so that i'll fill next fields according to selected items from picklist I wrote some codes on DBGrid.ColExit event and every thing is OK, but after i select an item from picklist and hit DOWN key (Next Row) DBGrid.ColExit doesnt triggered I Know there is Field On Change Event in Client Dataset's field editor, but i dont want to write code in data module I solved my problem with OnKeyDown event if Key = VK_DOWN then DBGrid1ColExit(DBGrid1); I thought may be there is a better solution Thank You
  8. Henry Olive

    DBGrid PickList Change

    Thank you Hans DBGrid.ColExit triggers ONKEYDOWN w/o any problem I thought if is there any better solution
  9. Henry Olive

    DBGrid PickList Change

    Thank you so much Lajos
  10. Henry Olive

    End Of File

    Good Day I have a DBGrid and it has some datas which they come from another table I don't want the user to INSERT a new record, user can just edit available datas My Code in DBGrid1KeyDown is : if (Key=VK_DOWN) then if MyTable.RecNo = MyTable.RecordCount then Abort; it works, but i'd like to be sure if the logic here is good or there is a better way Thank You
  11. Henry Olive

    End Of File

    Thank you so much Stano, Uwe
  12. Henry Olive

    End Of File

    Thank you so much Serge
  13. Henry Olive

    Make Bold DBRrid Row Color

    Good Day My DBGrid has JUST 2 rows (cant be more) Group Jan Feb..... ------------------- A 10 20 B 12 16 How can i make JUST second row's Fonts to Bold like below ? Group Jan Feb..... ------------------- A 10 20 B 12 16 Thank You
  14. Good Day I asked a similiar question while ago According to that replies i made below proc In my proc HIDDEN and NORMAL works but READONLY doesnt work even though i dont get any err.msg. what am i doing wrong ? Thank You procedure TFolders.RG1Click(Sender: TObject); var Attr : TFileAttributes; FolderPath : String; begin FolderPath:= CDS1FOLDERPATH.AsString; Attr:= TPath.GetAttributes(PChar(FolderPath)); if not TDirectory.Exists(FolderPath) then begin ShowMessage(FolderPath + ' not Exist'); Abort; end; if RG1.ItemIndex = 0 then // Read Only - RG1 = Radio Group SetFileAttributes(PChar(FolderPath), FILE_ATTRIBUTE_READONLY) else if RG1.ItemIndex = 1 then // Hidden SetFileAttributes(PChar(FolderPath), FILE_ATTRIBUTE_HIDDEN) else if RG1.ItemIndex = 2 then // Open (Not Read Only - Not Hidden) SetFileAttributes(PChar(FolderPath), FILE_ATTRIBUTE_NORMAL); end;
  15. Henry Olive

    Folder ReadOnly, Hidden, Normal

    Thank you so much Remy
  16. Henry Olive

    Make Bold DBRrid Row Color

    Thank you Peter My code : procedure TManTargets.DBGrid2DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if CDS2.Eof then begin DBGrid2.Font.Style:=[fsBold]; DbGrid2.Canvas.FillRect(rect); DBGrid2.DefaultDrawColumnCell(Rect, DataCol, Column, State); end; end; I dont get error msg. but the code doesnt make Bold the last row of the dbgrid
  17. Henry Olive

    Wrap texts in DBGrid

    D-10,4 Good Day MyField = Varchar(1500) MyDBGrid.Width = 400 Is it possible to wrap texts inside each row if my field's data longer than dbgrid field width ? Something like below ID History 1 aaaaaa bbbbb cccccc 2 xxxxxx Thank You
  18. Henry Olive

    Form Activate

    Good Day, VCL In Form1 my button code = Form2.Show; and Form2 opens front, but when i click the Form1(which is behind the Form2) Form2 should move behind of Form1 but No, like my button code was Form2.ShowModal , what am doing wrong ? Thank You
  19. Henry Olive

    Form Activate

    Thank you so much Remy
  20. Henry Olive

    VCL DB App. To Cloud

    Good Day Delphi : 10.4 Is there any program that converts a Vcl Db Appl. to Cloud ? If not which solution is best in Delphi (RadServer etc...) Thank You
  21. Henry Olive

    VCL DB App. To Cloud

    Thank you so much Die, David
  22. Henry Olive

    VCL DB App. To Cloud

    Thank you so much David Schwar, Die Hollander I'm really so sorry i missed to mention my DB, which is FB3 As far as i understand Azure fits to me, but i dont know if Firebird will be problem ?
  23. Henry Olive

    VCL DB App. To Cloud

    Thank you so much FPiette, corneliusdavid FPiette, i'm going to review the link you sent, thank you David, i just want my VCL program to access data from a cloud thank you
  24. Henry Olive

    Excel Get Column Number

    Good Day I'm trying to Import Datas from Excel into a table When i scan the excel sheet i need to know in which column i am var Sheet, Book : Variant; begin Book:= ExcelApp.WorkBooks.Open(OD1.FileName); Sheet := Book.Worksheets[1]; for Col:= Low to High do begin if Sheet.Cell.Column = 2 then // (i need to get column number here), ERROR Method Cell not supported doThis; end; end;
  25. Henry Olive

    Excel Get Column Number

    Thank you so much DelphiUdit, DieHollander
×