Missing data with revDatabaseColumnNamed [SOLVED]

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Emily-Elizabeth
Posts: 101
Joined: Mon Jan 03, 2022 7:10 pm

Missing data with revDatabaseColumnNamed [SOLVED]

Post by Emily-Elizabeth » Sun Feb 26, 2023 12:17 am

It seems that data of the last column of the last record of a SQLite database isn't being returned when using revDatabaseColumnNamed. I've searched the forums and not seeing anyone else with this issue, so the issue might be related to my code.

Code: Select all

command UpdateUserFieldControlContent stackLongID
   local databaseID
   put the cDatabaseID of stackLongID into databaseID
   local recordSetID
   put the cRecordSetID of stackLongID into recordSetID
   local recordSetCount
   put DBRecordSetCount(recordSetID) into recordSetCount
   local numberOfControls
   put the number of controls of stackLongID into numberOfControls  
   if (recordSetID is a number) then
      repeat with i = 1 to numberOfControls
         if (char 1 to 3 of the short name of control i <> "dbd") then
            if (databaseID <> EMPTY) AND (recordSetID <> EMPTY) AND (the cToolType of control i <> "label") then
               put revDatabaseColumnNamed(recordSetID, "dbdID") & LF & \
                     revDatabaseColumnNamed(recordSetID, "field_id_1039")
               set the text of control i to (revDatabaseColumnNamed(recordSetID, the cName of control i))  // where cName is "field_id_1039" and 
               // shows the correct values for the previous entries
            end if
         end if
      end repeat
   end if
end UpdateUserFieldControlContent
I'm using the OpenSource version of LiveCode 9.6.3 build 15543 on macOS
Last edited by Emily-Elizabeth on Tue Feb 28, 2023 5:04 am, edited 1 time in total.

Emily-Elizabeth
Posts: 101
Joined: Mon Jan 03, 2022 7:10 pm

Re: Missing data with revDatabaseColumnNamed

Post by Emily-Elizabeth » Sun Feb 26, 2023 12:29 am

Screenshot 2023-02-25 at 18.26.54.png
The data is in the database, but when I ask for the data I only get the dbdID. field_id_1039 and field_id_1040 appear as empty (for dbdID 5, the other four IDs work properly)

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Missing data with revDatabaseColumnNamed

Post by jacque » Sun Feb 26, 2023 7:24 pm

I'm not sure we can get the number of controls in a stack. What happens if you get the number of controls in the card?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Emily-Elizabeth
Posts: 101
Joined: Mon Jan 03, 2022 7:10 pm

Re: Missing data with revDatabaseColumnNamed

Post by Emily-Elizabeth » Sun Feb 26, 2023 8:13 pm

I think because there is the one card, it does work. There are 36 controls before it reaches the control added by the user and it does show the user data, except the last entry.

Emily-Elizabeth
Posts: 101
Joined: Mon Jan 03, 2022 7:10 pm

Re: Missing data with revDatabaseColumnNamed

Post by Emily-Elizabeth » Tue Feb 28, 2023 5:04 am

The issue was due to the record set being created before the data was added to the database. Creating a new record set solved the issue.

Post Reply

Return to “Databases”