Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren, 8 Monaten
Letzter Beitrag:
vor 2 Jahren, 6 Monaten
Beteiligte Autoren:
Ola, GWhiting, ICI, Fabrice Harari, ccc2, DarrenF, Stefan Bentvelsen, Yogi Yang

[WM18] How to modify data structure in Android?

Startbeitrag von Ola am 25.05.2015 12:05

Hi all,

I am learning Windev Mobile and currently playing around with the Android order management sample. There I changed the description of one data file, which is defined as "HyperFileFSQL Classic" in the analysis.

WM does not seem to be able to modify the file structures automatically like in Windev with HFSQL files, so, when I am launching the test "Go", I get an error stating
"Unable to create the data files native SQLite error. Error Number = 20" ...etc.

When I check the app's exe directory, the files actually seem to be in some ".db" file, which obviously is a SQLite database? There are no .FIC files in this directory.

Tutorial says that the data modifications can be done using replication? Online help says, that replication is available from version 19 on...(my WM is 18). Is this correct also for the structure changes of the files?

1. How can I manage the data structure modifications (changes in analysis) in an Android device using SQLite db?

2. Would it be possible to use HFSQL instead of SQLite in Android? How?

3. What would be the advantages and disadvantages between SQLite and HFSQL in Android?

Best regards


Hi Ola

first, you need to upgrade your windev mobile... There are so many changes in OS and functionsthat you need to keep curent if you don't want to just waste your time

second, automatic data structure modification is available for HF only, no matter if you are using WD, WB or WM... If you do use HFSQL (declare the files as HF classic in your analysis), then use hmodifyStructure in your code to update your files

As for your questions:
1. the same way you would manage a change of structure in MYSQL or MSSQL... You have to code it (alter table, or create a new table and transfer data)

2. Yes, delcare them as HF in the analysis

3. SQLite works on all android version, HF needs at least version 3.2 (from the top of my head)... HF supports automatic modification

Best regards

von Fabrice Harari - am 25.05.2015 12:46
Hi Fabrice

Thank you.

best regards

von Ola - am 25.05.2015 21:15
Fabrice Harari
2. Yes, delcare them as HF in the analysis

In which version of WM is HF supported in Android?

I am using WM17 and whenever I try to create a file in HF I get a warning from WM17.


Yogi Yang

von Yogi Yang - am 26.05.2015 04:00
Hi Yogi.

WM18 support HF on Android.

von ICI - am 26.05.2015 08:35
Fabrice (et al),

One question more about hModifyStructure:

1. Is it Ok to just run hmodifyStructure routinely in the initialization of the program, regardles whether there has been changes in the analysis or not?

2. Does it not slow down the starting of the program if run unnecessarily?

3 How can I check, whether the analysis has changed compared to the database or not?

Best regards

von Ola - am 26.05.2015 08:47
Hi Ola

a) For mobile: I make connection first and create button to start hmodifystructure()
b) For PC: I start application with parameter /update to start hmodifystructure(). Without parameter application don't start this function.

2. Yes. It slowing down start of application

This is my experience with hmodifystructure()

von ICI - am 26.05.2015 09:07
Hi Ola

1. in my experience, yes, as it is rare to have more than a few files for a mobile application

2. of course it does, but the amount of time needed to compare version is negligible for 10 or 20 files

3. It doesn't matter, as it is exactly what hmodifystrcuture is doing for you, when there is nothing to modify

Personally, I juts have a hmodifystrcuture in the init of any mobile project

Best regards

von Fabrice Harari - am 26.05.2015 12:52
Hi ICI, Fabrice,

I am now a bit wiser, thank you.

In my WD ERP I have used WDModfic and started it with a parameter in the ERP's program call.

Best regards

von Ola - am 27.05.2015 09:21
Hi Ola,

take care, afaik HModifyStructure() only updates the structure of files, NOT the links between the files !

von Stefan Bentvelsen - am 27.05.2015 14:12
Hi Stefan,

Thanks for the heads-up.

So the next question: how do I update the links, if necessary?

Best regards

von Ola - am 27.05.2015 19:16

Perhaps remove with HDeleteLink and then re-add with HAddLink?

von DarrenF - am 28.05.2015 13:45
Thank Darren,

Seems to be just another "half-baked" Windev-feature this HModifyStructure()!
Maybe it would be better to define the links from the very start of the app with those link-commands...

best regards

von Ola - am 29.05.2015 11:19
So to use HModifyStructure() you have to include the HFSQL libraries in the build, and to do that you have to be deploying to Android 3.2 or later.

Is there another option for automatic HFSQL updating pre-3.2?


von GWhiting - am 27.07.2015 12:38
... and I've just realised I'm using SQLite on Android so I'm assuming that HModifyStructure will work on that as the documentation says that once the SQLite connection is open you can use all database commands?

von GWhiting - am 27.07.2015 14:49
Hi Ola,

The main reason I using sqlite in my app is because you can find alot of sqlite editor to open and modify your sqlite db. while HFSQL don't have , this mean you have to either build such function in your app for all the tables or manual transfer to window .

until PC-soft come out android version of WDMAP and WDmodfic , i will stay with sqlite .

von ccc2 - am 27.07.2015 23:26
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.