how to create temporary database table with windev mobile

865 views Asked by At

I created an application for android with mobile Windev and in this application.

I have an order entry system. To do this I use an array variable to store in memory all customer orders before recording them at the last moment in the database HyperFile classic .

I was asked to change this way of doing it rather through temporary tables. So I documented including HDescribeFile () unfortunately it is not functional for android.

I use windev mobile 20 and windows 7. I think it is highly possible, but how? I still lose a little so I need your help. How to create a classic hf temporary file WM for android?

Thank you

2

There are 2 answers

0
gilles gabet On

Did you try this function HDescribeFile(), with HDescribeItem() ?

AFile is File Description
AnItem is Item Description
CUSTOMER is Data Source

// Describe the "CUSTOMER" data file
AFile..Name = "CUSTOMER"
AFile..Type = hFileNormal
AFile..FicCryptMethod = hCryptStandard

// Describe the "LASTNAME" item
AnItem..Name = "LASTNAME"
AnItem..Type = hItemText
AnItem..Size = 40
AnItem..KeyType = hUniqueKey
HDescribeItem(AFile, AnItem)

// Describe the "FIRSTNAME" item
AnItem..Name = "FIRSTNAME"
AnItem..Type = hItemText
AnItem..Size = 40
HDescribeItem(AFile, AnItem)

// Validates the description of the data file 
HDescribeFile(AFile)
...

// Create the data file named Customer (recognized because declared as data source)
HCreation(CUSTOMER)
0
Nightoni On

You can create your Table in project's Analysis and create you file at application first start.

Create a connexion

CNX_SERVEUR est une Connexion
CNX_SERVEUR..Utilisateur="admin"
CNX_SERVEUR..MotDePasse=""
CNX_SERVEUR..Serveur="192.168.1.5:4900"
CNX_SERVEUR..BaseDeDonnées = BaseDonnées_Nom
CNX_SERVEUR..Provider = hAccèsHFClientServeur
CNX_SERVEUR..Accès = hOLectureEcriture
CNX_SERVEUR..OptionsCurseur = hCurseurClient
CNX_SERVEUR..Compression=Faux
CNX_SERVEUR..Cryptage=hCryptageNon

Assign file to connexion

SI PAS HChangeConnexion("*",CNX_SERVEUR) ALORS
Erreur(HErreurInfo(hErrMessage))
RETOUR
FIN
SI PAS HCréationSiInexistant("*",Mon_password,"","",hOuvertureDifférée) ALORS
Erreur(HErreurInfo(hErrMessage))
RETOUR
FIN

Server connexion

SI PAS HOuvreConnexion(CNX_SERVEUR) ALORS
Info(HErreurInfo(hErrMessage))
RETOUR
FIN