PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Write to HFCS File outside project (not in analysis)
Write to HFCS File outside project (not in analysis)
Débuté par Joel, 16 avr. 2014 19:35 - 4 réponses
Posté le 16 avril 2014 - 19:35
Hi everyone -

Anyone have a nifty way to write data into a HFCS file if the analysis is not in the project?
Posté le 16 avril 2014 - 21:33
Hi

What do you want to do? With Hchangeconnection() you can define an other db.

regards

Allard
Posté le 16 avril 2014 - 21:34
Hi,

this one can be done, by hdescribefile, hchangeconnection aso.

You need to describe the structure of the external files, fields, keys. With hchangeconnection you open the connection only for that files, that you described. But if the external file is named equal to a existing file, you need to use halias.

But another way is, to open the external analysis, then hchangeconnection for the external files. After adding/changing external files, you need to reopen the project analysis.

yours
Alex
Posté le 17 avril 2014 - 01:06
Hi Joel,

Using queries is very easy.
I'm using a WD16 program to read files from a WB18 analysis (which cannot be opened by WD16).
But using HDeclareExternal you can still read them.
First you describe the connection and open it.
Then you do something like:
dsMySource is data source HDeclareExternal("MyFile1.fic","MyFile1",ct_MyConnection) HDeclareExternal("MyFile2.fic","MyFile2",ct_MyConnection) sSQL=[ SELECT * FROM MyFile1 WHERE xxxxx ORDER BY xxxxx ] sSQL=StringBuild(sSQL,yourParams) HExecuteSQLQuery(dsMySource,hModifyFile,sSQL) You don't even need to describe the files, just know the item names and go.
Just search and modify the resulting records using h commands.

Regards,
Piet
Posté le 18 avril 2014 - 21:11
Awesome - Thanks Everyone!

J