Databases in Delphi - Connecting to a database using code

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 58

  • @zanderv.l5607
    @zanderv.l5607 3 года назад +129

    who else is working on their PAT

  • @MikeWeideli
    @MikeWeideli Год назад +1

    Very clear. Works well for me.

  • @michaeldaniels5004
    @michaeldaniels5004 3 года назад +6

    wow, its the best video.
    Q: how to use OOP with database?

  • @staceyadams9954
    @staceyadams9954 2 года назад +2

    Nice and clear. I like how you explain why you do what you do. I only wish you used consistent, recommended code indentation practices. It makes code more readable, and given that you are influencing a whole new generation of Delphi coders, it would be nice for them to start off using generally accepted code formatting standards (e.g., contents within begin/end code blocks should be indented).

    • @KingSimba2077
      @KingSimba2077 6 месяцев назад

      but remember delphi is a dying language and Mr long is doing an exceptional job better than most people

    • @staceyadams9954
      @staceyadams9954 5 месяцев назад

      @@KingSimba2077 I don't disagree about the exceptional job (no one I can compare him to), but the more exceptional the job, the more someone's reach might be and, therefore, the more potential they have to influence the next generation in good and bad ways. The part about Delphi being a "dying language" is unfortunate. Such an amazing, flexible tool.

  • @thangbui7169
    @thangbui7169 3 года назад

    so touching for an excellent video

  • @lethabodichaba6250
    @lethabodichaba6250 3 года назад +3

    This helped me so much thank you

  • @DrippyKlifestyle
    @DrippyKlifestyle 3 месяца назад

    Hi Mr Long, i did everything as you said in the video but it gives me an access violation error when i run the program. Please help.

  • @KalaiVorneKisten-vw9fz
    @KalaiVorneKisten-vw9fz 3 месяца назад

    Hello sir, I wanted to ask, do I have have multiple data sources to go with each table or can I use one datasource for all my tables?

    • @MrLongITandCAT
      @MrLongITandCAT  3 месяца назад +1

      You only need one ADOConnection but you do need an ADOTable and DataSource for each table.

  • @stevenpaulsen5975
    @stevenpaulsen5975 2 года назад +1

    himister long my db is not being picked up when its in the same folder as my project it keeps looking for it in documents please help

    • @MrLongITandCAT
      @MrLongITandCAT  2 года назад +1

      Have you made the connection dynamically (using code) or have you set the settings manually in the ADOTable?

  • @theyluvvsande5178
    @theyluvvsande5178 Год назад +1

    Hii Mr long i followed every instruction on this video but whenever i tried running it it told me that it cannot find the program but i did put it on the host application

  • @lexls1973
    @lexls1973 Месяц назад

    I have problems with read. The create method fails.

  • @jordanyusuf4
    @jordanyusuf4 2 года назад

    Best video ever

  • @donartista1648
    @donartista1648 3 месяца назад

    please how to do connect button to access database in delphi , i want a dynamic login , so i can change database
    thank you

    • @MrLongITandCAT
      @MrLongITandCAT  3 месяца назад

      Have you seen the following video I did about a log in screen - ruclips.net/video/5kqUQYiC5Sc/видео.html

  • @hipinq1614
    @hipinq1614 2 года назад

    Sir I'm unable to find the 'OnShow' event by the event panel, what should i do to be able to connect the dbgrid to the datasource

    • @MrLongITandCAT
      @MrLongITandCAT  2 года назад

      Use the Forms OnActivate event. Click on the form, then go to the events tab and look for the Activate or OnActivate event.

  • @ebrahimismail4698
    @ebrahimismail4698 2 года назад

    When connecting the dbgrid to datasource, how do you specifiy which table you want to display ? Mines shows only one table

    • @MrLongITandCAT
      @MrLongITandCAT  2 года назад

      Your adoTable component has a tablename property that is set to the table name. If you want to change the dbgrid to another table, then first close the table (adoTable.Close) then reset adoTable table name property to new table then then open the table (adoTable.Open)
      Another option is to do the whole process (except adoConnection part) for the second table and have it displayed in another dbGrid.

  • @kaelinkesavjee2298
    @kaelinkesavjee2298 Год назад

    Hello mr long i have connected the database dynamically but im getting an Access violation adress error. The error is this line of code 'tblCD.connction := conCD;' thats the line of code it shows is the issuse when i run it through the debug, please help. Thank you

    • @MrLongITandCAT
      @MrLongITandCAT  Год назад

      Check that your database is in the correct location. Which version of Delphi are you using?

    • @kaelinkesavjee2298
      @kaelinkesavjee2298 Год назад +1

      @@MrLongITandCAT Hello mr long i have figured out what the issue is. i didnt add a owner to the second table that i created. Thank you for your help and guided video as it was very helpful

  • @jckson3059
    @jckson3059 Год назад

    Hey Mr long, I did everything from this video but when I try to run it, it tells me that it could not find the file

    • @MrLongITandCAT
      @MrLongITandCAT  Год назад

      Are you sure your database is in the correct folder. If you are using Delphi 10.4 or Delphi 11 then make sure the database is in the debug folder of your project folder.

    • @jckson3059
      @jckson3059 Год назад

      @@MrLongITandCAT how do I put it in the debug folder?

  • @mutombokabau1390
    @mutombokabau1390 Год назад

    You a G🎉

  • @mateodebeer3251
    @mateodebeer3251 2 года назад

    Hi mister long I have connected my date base dynamically exactly as you did in the video but I am getting a Access violation adress error if you could please help.

    • @MrLongITandCAT
      @MrLongITandCAT  2 года назад

      Which part of the code is highlighted when you get the message?

  • @sevketiskender3229
    @sevketiskender3229 3 года назад +1

    Hello. How to link two tables through ADOQuery? Database Access.

    • @MrLongITandCAT
      @MrLongITandCAT  3 года назад +3

      We have a video where we interact and setup an ADOQuery. Here is the link: ruclips.net/video/uaK_FZzmXug/видео.html

  • @emcicco
    @emcicco 2 года назад

    Is it possible to insert the connections string in an ini file?

    • @Zipher7
      @Zipher7 2 года назад

      Yes, just load the INI file before opening the connection and place it within the connectionstring := ini.readstring('adostring'); or how ever its called sorry forgot.

  • @jaydenwilliams6408
    @jaydenwilliams6408 6 месяцев назад

    Im getting a 'argument out of range' error. I know the problem is with the datasource not showing up but i dont know how to correct it

    • @MrLongITandCAT
      @MrLongITandCAT  6 месяцев назад

      Have you used the create command with your TDataSource?

  • @sodanotsolved
    @sodanotsolved Год назад

    14:19

  • @fleqq1827
    @fleqq1827 7 месяцев назад

    I get an access violation error sir

    • @MrLongITandCAT
      @MrLongITandCAT  7 месяцев назад

      Can you tell which part of the code it is giving the error for?

    • @fleqq1827
      @fleqq1827 7 месяцев назад +1

      @@MrLongITandCAT it's alright sir I found out why it happened and fixed it

  • @Holy777-j7i
    @Holy777-j7i 3 месяца назад +1

    2024 anyone 😭

  • @Дубровский-ч4с
    @Дубровский-ч4с 2 года назад

    Лучше бы на компонентах понятнее

  • @nguyenquangminh3464
    @nguyenquangminh3464 3 года назад

    so touching for an excellent video

  • @namlengoc9844
    @namlengoc9844 3 года назад

    so touching for an excellent video