PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
Problem with VFP Numeric fields
Problem with VFP Numeric fields
Started by Dennis, Jan., 15 2021 10:15 PM - 1 reply
Connect yourself…
Dennis
#1
Posted on January, 15 2021 - 10:15 PM
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.
Report
0
0
Dennis
#2
Posted on January, 17 2021 - 4:07 PM
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.
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text