FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
[WD5.5] Field exists
[WD5.5] Field exists
Débuté par Patrick Vandebroek, 15 déc. 2004 10:48 - 4 réponses
Connectez-vous…
Patrick Vandebroek
#1
Posté le 15 décembre 2004 - 10:48
Hi All,
I have a procedure to import data from a Dbase file, but there is a problem with older versions where fields are not existing.
Can I check in WD5.5 if a field exists in a Dbase file?
Regards,
Patrick
Signaler
0
0
Clive Dickinson
#2
Posté le 16 décembre 2004 - 00:49
Hi All,
I have a procedure to import data from a Dbase file, but there is a problem with older versions where fields are not existing.
Can I check in WD5.5 if a field exists in a Dbase file?
Regards,
Patrick
Why not have several dbase file definitions available and ask the user at runtime which version is to be used?
hth
Clive
Signaler
0
0
Peter Somplatzky
#3
Posté le 16 décembre 2004 - 00:49
Hi Patrick,
you can open the DBF File with fOpen and seek for the Fieldname lets say in the first 500 Bytes. To be exact: (Number of fields + 1) * 32 Bytes = app. size of header.
Here you find a descrition of the DBF Header:
http://www.cs.cornell.edu/Courses/cs212/2001fa/Project/Part1/dbf.htm
Peter
Hi All,
I have a procedure to import data from a Dbase file, but there is a problem with older versions where fields are not existing.
Can I check in WD5.5 if a field exists in a Dbase file?
Regards,
Patrick
Signaler
0
0
Patrick Vandebroek
#4
Posté le 17 décembre 2004 - 17:19
Why not have several dbase file definitions available and ask the user at runtime which version is to be used?
hth
Clive
That was also my first intention, till I realised what a mess this was.
In the past, nobody had ever wrote any documentation.
There are over 1000 clients who used the older versions of this program and there are clients which had the same version, buth the file defintion is different.
I don't have an overview of the file definition on each version, and if I had a file definition, it still can be different by several clients.
You see why I need to check if a field is existing.
Regards.
Signaler
0
0
Al
#5
Posté le 17 décembre 2004 - 23:07
G'day Patrick
As an alternative to the Fopen option, there are dbase commands to list a file structure, so you could not run a short dbase program to open each file and list its structure to a text file, then read the text file in WD5.5 to get the structure and modify your read in program accordingly to include or skip missing fields.
I had a similar problem a few years ago and I simply built a master set of dbase files with all the possible fields for each file then at each site I ran a dbase program to append the data into my files and then read in from them.
Regards
Al
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte