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!

list sometimes returns unsorted .... solved

Status
Not open for further replies.

opticalman

Programmer
Nov 6, 2006
103
US
I program for my own small business use.

I have a VFP 7 program that has been and is currently running for 15 years successfully with a SQL 2008 then 2016 backend. It has been on the same 8 PCs all this time. 1 pc as the sql server and the others as clients.

I made a copy of the data and software and installed it on a laptop. It is a stand alone installation, not on network . My first time to do that. I installed SQL 2019. It appeared to work fine. Now one of my tables is displaying out of order. It's a list of ledger transactions for the customer. The customers with smaller lists still work. I can add new entries and the new entry is displayed at the bottom of the list, as it should be. But some of the customers with longer lists (100 items), the new entry does not show. As I scroll back in time through the list, I start to see entries that are no longer in order of date. As best I can tell, the new data is not lost, but sent somewhere else in the list.

I would appreciate suggestions on where to look for answers or if you have encountered a similar problem.

Jim Rumbaugh
 
That's not enough information to know what's really happening.

But if you don't query data with an ORDER BY to sort it, you get nothing like DBFs physical order. In general you can't expect chronological order from SQL Server.

Chriss
 
Jim,

I agree with Chris. It is impossible to diagnose the problem without some more information.

In particular, when you say a table "is displaying out of order", where exactly are you seeing that? Is it within your client-side application, or in a Browse window within the VFP IDE, or in one of the interactive tools on the server?

Given that you have only seen this problem on your stand-alone laptop, it seems likely that it is caused by whatever is different on the laptop compared to your network. Is it a difference in the version of the SQL back-end? (You mentioned "SQL 2016" and "SQL 2019". It would help to be more precise about the server. The term SQL covers many products and systems. Do you mean Microsoft SQL Server, or what?).

If you could be a bit more precise in describing the problem, we will do our best to help.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
One more simple idea: Wehn you talk of a grid, that shows a workarea in current index sort order. And that can cause a new record to appear anywhere within the grid depending on where a new (perhaps blank) record would show.

Chriss
 
Also, isn't there a NOFOLLOW keyword for Browse, that determines if new records appear at the end of the Browse window or in their correct index order? I can't see any mention of that in the Help, but I feel sure something like that exists. And if it exists for a Browse, there is probably an equivalent property for a grid.

This might not be relevant of course. I'm just guessing that the problem manifests itself in a Browse or a grid.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
to Mike and Chris

Thank you for your replies. Though I did not give you enough info, your responses were helpful. I was wondering if there was any known problems with SQL 2019. Since neither of you mentioned it, I went to work again, trying to solve the problem.

The good news is, the problem is resolved. I am ashamed to say I am not sure what fixed it. I suspect I did poor installation of the software into the laptop. I did a copy and paste of all my old files from the working computer to the new laptop, and now the problem is gone.

If a problem re-occurs, I will post more info for people to work with.

thank you again.

jim Rumbaugh
 
Thanks for letting us know, Jim. It's always frustrating when a problem goes away without you finding out what went wrong in the first place, but it's good to hear that you are on top of it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike Lewis said:
It's always frustrating when a problem goes away without you finding out what went wrong in the first place

I also don't like it, but sometimes when I was persistent and found out, it turned out to be simple and unimportant in the sense of something to learn from.

What can lead to such problems is programming too defensive, ie suppressing errors could be one reason you only get wrong behavior but no error that would point out what's going wrong, like a missing index tag.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top