• 0

[Delphi] Posting MemoField To Database


Question

6 answers to this question

Recommended Posts

  • 0

Long time since I used Delphi, but try this.

First, set DBMemo Datasource and Datafield properties.

Add this code to where you post the data, like button's OnClick event.

// Insert to insert new record and Edit to edit current record.
// Let's insert new record for now.
DBMemo1.DataSource.DataSet.Insert;
DBMemo1.DataSource.DataSet.FieldByName(DBMemo1.DataField).AsString := DBMemo1.Text;
DBMemo1.DataSource.DataSet.Post;

  • 0
  Wilhelmus said:

Long time since I used Delphi, but try this.

First, set DBMemo Datasource and Datafield properties.

Add this code to where you post the data, like button's OnClick event.

// Insert to insert new record and Edit to edit current record.
// Let's insert new record for now.
DBMemo1.DataSource.DataSet.Insert;
DBMemo1.DataSource.DataSet.FieldByName(DBMemo1.DataField).AsString := DBMemo1.Text;
DBMemo1.DataSource.DataSet.Post;

Thanks for the help. Doesn't seem to work though, well what I have got is the following:

DataMod.dsTransactions.DataSet.FieldByName(DataMod.dsTransactions.DataSet.DataSetField.AsString) := Receipt.Text;

I can a left cannot be assigned to error, btw I do have the edit etc. The above was done on using auto complete thinggy as the exact code doesn't match. Any ideas?

Also just noticed, I am not using a DBMemo field. I need to add stuff too it as I go along you see. If I was to use a DBMemo I would have to make loads of changes to me code.

  • 0

^

well that is poor programming on your behalf- you have tightly bound your code to the

Either way I would move to dbmemo, it makes life simple.

change

DataMod.dsTransactions.DataSet.FieldByName(DataMod.dsTransactions.DataSet.DataSetField.AsString) := Receipt.Text;

to

DataMod.dsTransactions.DataSet.FieldByName(DataMod.dsTransactions.DataSet.DataSetField.AsString).Value := Receipt.Text;

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Microsoft explains how Xbox Ally runs a lightweight bloat-free Windows 11 by Sayan Sen Microsoft today announced new AMD Ryzen-powered Xbox Ally gaming handhelds. There is a duo of these new devices, and they run Windows 11. The version of Windows 11 (Home) running on these new handhelds is specially optimized, says Microsoft. Jason Beaumont, the Vice President of experiences at Xbox, said that the new Xbox Ally consoles are essentially running an optimized and bloat-free Windows 11. He said: "We were able to take people who have been working on the Xbox OS for 20 years or more and have them work directly on the Windows codebase and start reimagining what that operating system looks like for this form factor. When the player boots into the full-screen experience, there is a whole bunch of Windows stuff that doesn’t get loaded. We’re not loading the desktop wallpaper, the taskbar, or a bunch of processes that are really designed around productivity scenarios for Windows." Roanne Sones, corporate vice president of gaming Devices and ecosystem at Xbox added: "We’ve reduced many notifications and pop-ups, and we will continue to listen to feedback from players to make continued improvements." Brianna Potvin, principal software engineering lead at Xbox, further added some details about memory optimizations: "This isn’t surface-level changes, we’ve made significant improvements. Some of our early testing with the components we’ve turned off in Windows, we get about 2GB of memory going back to the games while running in the full-screen experience. If you’re booting your device into the full-screen experience and you’re putting it down and it’s going to sleep, it draws one-third of the idle power draw than if it was booting the same device into the [Windows] desktop experience." Via: The Verge
    • Trayy 1.01 by Razvan Serea Trayy is an open-source Windows application that enhances the system tray by allowing users to integrate web applications, shortcuts, and other utilities directly into the tray for quick access. Inspired by RBTray, it supports Progressive Web Apps (PWAs), enabling seamless integration of modern web-based tools. Trayy offers a lightweight and minimal interface that minimizes desktop clutter and maximizes productivity by providing easy access to frequently used applications without interrupting workflow. Designed for simplicity, Trayy enables users to launch apps and access notifications with a single click. It allows for custom tray icons, app organization, and offers support for system tray management. The application is highly configurable and can be easily installed without complex setup processes, making it suitable for both novice and advanced users looking to streamline their desktop environment and optimize their workspace with minimal overhead. Tested on Windows 10 and 11 with support for toast notifications. Windows Defender may flag Trayy with a false positive, but there is no cause for concern. The application is safe to use and fully open-source, allowing anyone to inspect the code for transparency. Trayy 1.01 changelog: Fixed a bug that was causing all Chrome/Edge windows to close when closing only one window Download: Trayy 1.01 | 383 KB (Open Source) View: Trayy Website | Getting Started | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Yeah, I can think of very few venders who implemented it. Still, kind of a shame to remove the feature, even if no one was using it.
    • At Fate's End announced by Spiritfarer studio, an action game about fighting family by Pulasthi Ariyasinghe Thunder Lotus Games appeared at the Xbox Games Showcase today with a surprise game announcement. That may be a familiar name for indie game enjoyers, as it's the studio behind titles like Jotun, Sundered, Spiritfarer, and most recently, 33 Immortals. Now, the company is developing another narrative-focused action game titled At Fate’s End, but with a twist. The debut trailer is above. The title focuses on Shan, a divine-sword-wielding princess that has to confront her estranged siblings in "intense, emotionally charged duels." It's not all about sword fighting, as the studio says that the grand battles against family members will be won through dialogue, psychological insight, and hard-won knowledge of shared history. “With At Fate’s End, we’re taking everything we learned from Spiritfarer — that rich emotional core, that interplay of mechanics and narrative — and pushing it into thrilling new territory,” said Nicolas Guérin, Creative Director at Thunder Lotus. “This is a more intense, more action-driven game, but no less intimate. It’s about how families break apart — and how they might come back together.” Here are the key features listed by the developer: Dual Combat System: Master a blend of fast-paced and tactical swordfighting and clever, choice-driven dialogue battles. Narrative Skill Tree: Grow your abilities through your familial connections and learn to weaponize your knowledge. Emotional Encounters: Every duel is a pivotal emotional climax, shaping both the story and your relationships. Multiple Endings: Your choices forge your family’s future — or doom it. Stunning World to Explore: Discover a fantastical realm, beautifully crafted with Thunder Lotus’ signature art style. At Fate's End is coming out sometime in 2026 for PC (Steam, Microsoft Store, and Epic Games Store), Xbox Series X|S, and PlayStation 5. It will also be a day-one Xbox Game Pass release.
  • Recent Achievements

    • Dedicated
      Epaminombas earned a badge
      Dedicated
    • Veteran
      Yonah went up a rank
      Veteran
    • First Post
      viraltui earned a badge
      First Post
    • Reacting Well
      viraltui earned a badge
      Reacting Well
    • Week One Done
      LunaFerret earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      480
    2. 2
      +FloatingFatMan
      264
    3. 3
      snowy owl
      232
    4. 4
      ATLien_0
      231
    5. 5
      Edouard
      173
  • Tell a friend

    Love Neowin? Tell a friend!