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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 9.0 SQL select command on .dbf 3

Status
Not open for further replies.

Steve Yu

Programmer
Nov 6, 2021
90
US
We have a 30-year old SBT package that was written in dBase III and ported over the years to VFP 3,6, and now 9.0.
It is working great and we don't want to change anything.
I'm looking to try get around the VFP restriction that same .dbf can not be opened in more than one work area.
The need is for a shared subroutine to open a commonly needed .dbf for processing without having to worry if that .dbf is being opened in any of the calling programs.
New to SQL, I thought I could get around that restriction by using SQL select cursors since it seems to me I can create multiple cursors against the same .dbf. To my surprise, the target .dbf is opened in a random work area when I issued the command 'Select * from .dbf into cursor testcursor alias c1'. And upon return to the calling program the target .dbf remains open and will cause an error to occur if the calling program tries to open the same target .dbf in a different work area.
Can someone help with some insight if my description can be understood ?

Much obliged,
Steve the gray haired xBase programmer in Houston, a very experienced one nonetheless.
 
Thank you, Chriss for the example.
will try.

Steve Yu
 
I also read your other thread, I think you will want to stay within VFP at first.

We're working on a detail problem, I'm sure you have many such problems of design decisions of the past like using ON KEY, that should be brought to better ways. There's no reason to change to a graphical and mouse oriented UI, as you know I mainly suggested using forms for getting new private datasessions. There also is the session base clase that could be used for that matter.

As your ON KEY give the user some list for choice or filter option my idea of them is like popups, and you can also use a usual winform, take away the border and titlebar and work on it character oriented. Not sure if only using the main _screen character oriented offers an easy way of overlay windows or screens, I can imagine from older DOS apps that's possible, I mainly used a character based editor with windows in DOS style as I programmed Borland Pascal, but I know less of Foxpro Screens, I assume they also span an area with the row/column coordinates @ commands also use.

By the way, the community based, corrected and extended VFP9 help file that's a download of the VFPX project on github and that's made available on the web at vfphelp.com also contains help topics from Fox 2.6 which only point out backward compatibility in Microsofts help file, so you also have the reference often enough necessary to understand and modify or extend code.

The popup menu demo will likely look foreign, but notice a popup can also be defined with the same font, so it merges with a character base UI.

Chriss
 
the communita based, corrected and extended VFP9 help file that's a download of the VFPX project on github and that's made available on the web at vfphelppp.com also contains help topics from Fox 2.6 which only point out backward compatibility in Microsofts help file, so you also have the reference often enough necessary to understand and modify or extend code.

I can't tell you how useful I have found the community-based Help file. So often, when working on legacy code, I've needed to check the syntax of old dBASE / Foxbase commands and functions, where the official Help file simply says that they are maintained only for backward compatibility. The version from GitHub neatly solves that problem, as well as having corrections to certain VFP 9 Help topics.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top