FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Problem with VFP Numeric fields
Problem with VFP Numeric fields
Débuté par Dennis, 15 jan. 2021 22:15 - 1 réponse
Connectez-vous…
Dennis
#1
Posté le 15 janvier 2021 - 22:15
Hello,
I want to migrate a huge Foxpro application and I am looking into WINDEV. After spending some hours trying things out, I ran into one problem I could not solve.
Because I want to transition in parts, I have to work with the VFP database. I use the VFPOLEDB driver and reading and writing works fine except when my WHERE condition contains a numeric field:
wSQL
is
SQL Query
=
[
SELECT * FROM USER WHERE id = 3
]
HExecuteQuery
(
wSQL
,
hQueryDefault
)
If the fieltype "id" is an integer it works. But if it's type is numeric(2,0) then the result is as if the 3 is a 0. So I get the record from user with the id 0. Same is when I use "where id > 3", I get all records with id > 0 and with "where id < 3" I get records with id < 0.
This returns nothing:
HExecuteQuery
(
wSQL
,
hQueryWithoutCorrection
)
This returns the correct value:
HExecuteQuery
(
wSQL
,
MyCon
,
hQueryWithoutCorrection
)
Can someone explain this to me why it works withoutout naming the connection when the field is an integer, but when the fiels is numeric, I have to name the connection and also use the parameter?
It seems like windev is altering the query in a way that the database can not handle the comparison.
Is there a way I can see what the query looks like that WINDEV is sending to the database?
Thank you all.
Signaler
0
0
Dennis
#2
Posté le 17 janvier 2021 - 16:07
I figured it out:
Changing the field format in the analysis from "decimal (WLanguage numeric), integer part: 3, decimal part:0" to "integer, format 999" worked.
I also had problems when modifying a record with a logical (boolean) field. Changing it in the analysis from "boolean" to (integer, format 9) worked, too.
I don't know if this is the best approach, because I have to change a lot of fields in the analysis, but it is the only way I got it working.
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