PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Time item in database read only error
Time item in database read only error
Débuté par Ben Clarke, 15 jan. 2017 21:11 - 6 réponses
Posté le 15 janvier 2017 - 21:11
Hi,

I'm trying to store a time in a hfsql databaase. Its a time inputed by the user and so is held in a variable before trying to add it to the file. However when trying to write it in the database I get a read only error.

Here is the code:

HSeekFirst(RoadShow,RoadShowID,Form)
IF HFound(RoadShow) THEN
IF EDT_Authorisation = RoadShow.Authorisation THEN
Client_RoadShow.ClientID = ClID
Client_RoadShow.RoadShowID = Form
Client_RoadShow.TrackTime = Time
Client_RoadShow.Comments = Comments
HAdd(Client_RoadShow)
MySelf..Visible = False
ELSE
Info("Incorrect Authorisation","Please get a SAM member to confirm your track time")
END
END

The code is on a button press and causes this error message:

'The "TrackTime" item is read-only.'

Note that I can't ScreenToFile this as it is on an authorisation internal window which shows after entering the information and sending it.

How can I avoid this? I can't find any mention on how to change it.

Cheers,

Ben Clarke
Posté le 16 janvier 2017 - 12:51
Hi Ben

are you sure you declared that item as a TIME and not a TIMESTAMP?

TimeStamp are filled automatically (htus read only) and are not
supported on mobile to boot

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 1/15/2017 à 3:11 PM, Ben Clarke a écrit :
Hi,

I'm trying to store a time in a hfsql databaase. Its a time inputed by
the user and so is held in a variable before trying to add it to the
file. However when trying to write it in the database I get a read only
error.

Here is the code:

HSeekFirst(RoadShow,RoadShowID,Form)
IF HFound(RoadShow) THEN
IF EDT_Authorisation = RoadShow.Authorisation THEN
Client_RoadShow.ClientID = ClID
Client_RoadShow.RoadShowID = Form
Client_RoadShow.TrackTime = Time
Client_RoadShow.Comments = Comments
HAdd(Client_RoadShow)
MySelf..Visible = False
ELSE
Info("Incorrect Authorisation","Please get a SAM member to
confirm your track time")
END
END

The code is on a button press and causes this error message:

'The "TrackTime" item is read-only.'

Note that I can't ScreenToFile this as it is on an authorisation
internal window which shows after entering the information and sending it.

How can I avoid this? I can't find any mention on how to change it.

Cheers,

Ben Clarke
Posté le 16 janvier 2017 - 23:35
I am quite sure. I cannot see any reason for TrackTime to have issues. What could cause a Time database item to appear read only?
Posté le 17 janvier 2017 - 11:23
Nothing, hence my question...

Le 1/16/2017 à 5:35 PM, Ben Clarke a écrit :
I am quite sure. I cannot see any reason for TrackTime to have issues.
What could cause a Time database item to appear read only?
Posté le 17 janvier 2017 - 21:41
Here is exactly how the database file is setup





Its definitely set to a Time variable...
Posté le 18 janvier 2017 - 13:14
Hi Ben

I looked at your code again, and you may be in the case of a wrong error
message:

TIME is a reserved word in wlanguage (it's a type of variable), so try
to rename that element, whatever it is, in the line:
Client_RoadShow.TrackTime = Time

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Le 1/17/2017 à 3:41 PM, Ben Clarke a écrit :
Here is exactly how the database file is setup






Its definitely set to a Time variable...
Posté le 19 janvier 2017 - 01:47
That hasn't helped, unfortunately.