Databases in Delphi - Searching for one record in a table

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2024

ความคิดเห็น • 16

  • @i_fw_the_cure
    @i_fw_the_cure 4 หลายเดือนก่อน +2

    HAAAA SIRR THE U2 JOKE HAS ME IN STITCHES🤣

  • @starlit_arch0818
    @starlit_arch0818 4 หลายเดือนก่อน

    What do i do if i get an error saying that i "cannot perform this function on a closed dataset" when i run my program

    • @MrLongITandCAT
      @MrLongITandCAT  4 หลายเดือนก่อน

      It is probably because the ADOTable is not active. Check out the properties of the ADOTable and see if Active is True.

  • @DanDeDrummer
    @DanDeDrummer 3 ปีที่แล้ว +1

    I am finding myself using Delphi again after 5 years out of High school, so I am using your videos to reminisce and to refresh, I am just wondering is it better to use SQL for locating, sorting, filtering etc. or is it better to use the methods you show in your "Databases in Delphi" playlist? What are the pros and cons of each?

    • @MrLongITandCAT
      @MrLongITandCAT  3 ปีที่แล้ว

      I tend to use a bit of both. The SQL purest in me always loves the "clean-ness" of SQL but sometimes the other features are easy. In basic database programs I haven't seen a major difference but it may be for more larger applications. There are also other database connection components in Delphi like FireDAC which more people are moving towards.

    • @DanDeDrummer
      @DanDeDrummer 3 ปีที่แล้ว

      @@MrLongITandCAT Thank you. Another question I have is, we were taught/shown how to add/remove records to Access databases from Delphi, but how would I add a new field from Delphi to Access? (To use the tblCD as an example, say I want to add "Year Released" as a field to the database)

    • @MrLongITandCAT
      @MrLongITandCAT  3 ปีที่แล้ว

      @@DanDeDrummer I have never tried that before. I must idea would be to use SQL to add it like I have shown in the Insert, Edit and Delete videos using the ADOQuery component . You could use the following SQL statement:
      ALTER TABLE tblCD
      ADD YearReleased int;
      then run the ExecSQL command on the ADOQuery.

  • @alecpienaar4856
    @alecpienaar4856 ปีที่แล้ว

    Afternoon mr.Long, Could you do a video on searching for a record through a date for eg. an finance expenses table with multiple monthly records

  • @preciousthom8834
    @preciousthom8834 2 ปีที่แล้ว

    Whenever I try this I end up running into a problem. Could not convert variant of type (String) into type (Double)

    • @MrLongITandCAT
      @MrLongITandCAT  2 ปีที่แล้ว

      Are you trying to display something in a rich edit or memo control? One of the fields you are trying to display is not a string field (integer or real) so you must convert it using IntToStr or FloatTostr.
      Example:
      RedDisplay.Lines.Add( tblStudents['Surname'] + #9 + INTTOSTR( tblStudents['Mark'] ) );

  • @puertogaleraseismicstation8787
    @puertogaleraseismicstation8787 2 ปีที่แล้ว

    Nice videos it helps a lot, keep it up Sir. 😇

  • @vi_bes.23
    @vi_bes.23 ปีที่แล้ว

    Why not after searching say exit?

    • @MrLongITandCAT
      @MrLongITandCAT  ปีที่แล้ว

      It's not good style and you need that flag variable so you can display if you havent found it.

  • @succduc
    @succduc 3 ปีที่แล้ว +1

    Could you not just say - Exit;

    • @josephpereira4368
      @josephpereira4368 2 ปีที่แล้ว +1

      I think you could use Break as Exit would end the procedure

    • @succduc
      @succduc 2 ปีที่แล้ว

      @@josephpereira4368 Brother is doing last minute studying xD