PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Creating Data Files
Creating Data Files
Débuté par Antonio Díaz, 18 fév. 2021 20:34 - 3 réponses
Membre enregistré
71 messages
Popularité : +2 (2 votes)
Posté le 18 février 2021 - 20:34
Hello,

I am a new user to Windev, Webdev.... I created an Analysis with 5 tables and started playing with it. However, if I create the Pages to add new records or to browse the existing ones, I get no errors. But when updating certain tables that are linked to another table I keep getting errors saying that the table does not exist, which is actually true. My question is, shouldn't this tables be created automatically once they are needed? If not, how can I create them myself?

Thank you in advance.

--

Antonio Diaz
Emphasys Software, S.C.
Membre enregistré
32 messages
Popularité : +1 (1 vote)
Posté le 19 février 2021 - 11:24
Hi Antonio

One way would be to simply add a new record to the file and then delete it

hReset(MyFileName)
hAdd(MyFileName)
hDeleteAll(MyFileName)

I'm not sure if you need the second two lines as the hReset should create the file on it's own.

Hope this helps

--
Simon Phillips
OtterReg Software
Posté le 19 février 2021 - 12:47
there are several ways of managing data file creation...
You can:
- in the project description, check the option to AUTOMATICALLY create the file at the first access (read/write, doesn't matter)
- in your project init code, add a line like hcreationifnotfound("*")
- or specifically create each file when you need it with hcreationifnotfound(MyFileName)

in NO case do you need to create a record to create a file
Membre enregistré
71 messages
Popularité : +2 (2 votes)
Posté le 22 février 2021 - 20:57
Thanks Simon, Argus, I've got it!

--

Antonio Diaz
Emphasys Software, S.C.