Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re: Visual FoxPro Select SQL Stmt fails only on Windows Server 2019.

Status
Not open for further replies.

Patrick O Hara

Programmer
May 31, 2022
1
IE
Visual FoxPro Select Stmt fails only on Windows Server 2019
now remember there 1000 SQL STMTS IN THE APP. running since 2006 on Windows XP, 7, 10 and several versions of Windows Server.
the post here really don't understand the issue (WINDOWS SEVER 2019 cannot run this code every other O/S can )
these posts say re-write all your code to now handle a new O/S that is non-starter..
now some1 mentioned SMB Server Message block ..
FoxPro cannot be the problem or i just refuse to use 2019


This only the first one I was testing since this was report where sometimes the table was reported not
open
the open table command preceeds this SQL Stmt

TDASOF = date field 03/17/2022.
artype is Character
arstat is Character
this query is 10+ years old and runs successfully on windows 10 and the older WINDOWS 2008 Server.
Select * from A_ARMASTSBT where balance <> 0.00 And ( Empty[ artype] Or artype=[C] ) And arstat <> "V" And INVDTE <= TDASOF into Cursor CRSGOTAR Readwrite
 
 https://files.engineering.com/getfile.aspx?folder=704153f1-c7e5-4c13-92d2-26854721096c&file=TS11__2__incompatible_with_MAIN_SYSTEM.PNG
Mike Yearwood already addresses several issues, but what's the actual problem?
An error? If yes, which error?
Not the expected result?

I see, the attachment has an image: Operator/operand type mismatch. You better post a picture in the post, the camera icon "Image" in the toolbar of the post is for that and offers several easy to understand ways to add an image to a post.

One or more data type is not as expected. One thing I'm extremely sure about already, that has nothing to do with the Windows version. Windows has no influence over fields of a dbf or cursor, doesn't change them nor does it influence the VFP language about processsing or comparing them.

To find out what's not working with the data type it has, please do this instead of the query and tell us the letters coming out:
Code:
SELECT A_ARMASTSBT (perhaps need to first USE A_ARMASTSBT.dbf)
? 'balance:'+vartype(balance)+' artype:'+vartype(artype)+' arstat:'+vartype(arstat)+' invdte:'+vartype(INVDTE)+' tdasof:'+vartype(TDASOF)

To have it easy to transfer this here, make it
Code:
_cliptext = 'balance:'+vartype(balance)+' artype:'+vartype(artype)+' arstat:'+vartype(arstat)+' invdte:'+vartype(INVDTE)+' tdasof:'+vartype(TDASOF)
Then you can simply paste it here.

Chriss
 
I think you are going to need to break the SQL statement down until you find what is wrong, halting the process after each run
it has to be a comparision thing so you can leave the Empty() part.

Start with:
Code:
Select * from A_ARMASTSBT where balance <> 0.00   into Cursor CRSGOTAR Readwrite
then
Code:
Select * from A_ARMASTSBT where balance <> 0.00 And Empty[ artype]    into Cursor CRSGOTAR Readwrite
then
Code:
Select * from A_ARMASTSBT where balance <> 0.00 And ( Empty[ artype] Or artype=[C] )   into Cursor CRSGOTAR Readwrite

and so forth until it fails...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top