Visual FoxPro (VFP), and its predecessor FoxPro, is a data-centric, object-oriented, procedural, database programming language and IDE from Microsoft last released in 2007 that still has some active use due to its low cost of deployment and fairly rapid development. In 2008, Microsoft released a set of add-ons for VFP's xBase components to allow interoperability with various Microsoft technologies. It allows data processing against its native file-based data tables or database servers such as SQL Server.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have a table that looks like this:

For any record that has one of the descrip fields empty, I need to fill it with the value of the descrip field in the next column to the right and move the others over, if any.

If only the first field, decriptn is populated, the record gets deleted.

The result will look like this:

What's the best way to do this?
Python 3 Fundamentals
LVL 13
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Connecting VFP Database File to Excel (pivot table).

I have a table in Visual Foxpro 9 that is being updated daily.
I would like to create a pivot table in Excel based on this table.

These are the steps I am following - but it is not working.. Please help.

1-Go to ODBC connection. Create a new one. Based on "Microsoft Dbase-Driver (*.dbf) _- Setup the name (DataCon) - Select version DBase IV - Select the directory where the Table is
2-go to excel - create a new document- Click on insert Pivot Table - Click on Choose connection -Browse for More-New source-ODBC DSN -Next - Select DataCon-Next- Select the table - raw-Name the connection (test.odc)-Finish
It gives me "ODBC DBase Driver - External Table is not in the expected format !
While I'll be delighted if anyone comes forward with a solution to this problem, I'm not expecting it. I'll settle for better ways, than I've so far tried, to diagnose it.

It is a perennial problem I've failed to resolve for about 15 years.  The symptom is simple to describe. In certain circumstances, the menu bar created with foxpro's menu.mpr or derivatives will suddenly start to flicker as though it's being refreshed or reloaded about 5-10 times a second.

I've never managed to figure out what causes this behaviour because it NEVER happens in the programming environment, only in the compiled exe.

I've tried writing loop traps and counters. I've tried writing simple logic traps which prevent any calls to run the menu code once it has been activated.

It has also, till now, been a low priority because it's occurrence has been rare, intermittent and unpredictable. On some installations it happens more than others (say, daily) and on some never. These differences persist even on identical workstations with identical sofware installed and running on the same network.

It's just become a priority because a new form I've added to the mix is causing the problem in an entirely predictable and routine manner - i.e. every time the modal form is invoked, on release back to the main form, we get the flicker. The flickering, incidentally, doesn't prevent the sofware working although it does become sluggish. Some users simply ignore it. Others are disturbed by it.

In Visual FoxPro, there is a dialog that allows me to convert and SCX to a PRG.  I have 400 SCXs to convert.  Is there a way to do this in batch mode?
I have several VFP applications running at few customers. As time went by some of them were "forced" to switch to windows 10.

Unfortunately those who switched encountered "file access denied" popup every 5-10 min while using the system.
While other users (on Windows 7 ) did not encounter any issue -using the same app.
I need to say that the app is on a windows 2008 (or 2012) server. and the users are accessing the app over the network.
The database used is the native DBF of VFP.

The problem would only popup when the app is idle.
I had posted already this here and one of the recommended solution was to check for Network Card going to sleep. It was not the case.
I also saw another post that was talking about OpLocs
Tried it but again it did not work.
I also tried tweaking the NIC but again did not work.
My problem is that nowadays Windows 7 is becoming less and less supported when it comes to hardware (many new PC chipset are not compatible with Windows 7).
Now another added layer of complexity is that the Application is sitting in a Hyper-V VM - Host and guest are both Win2008 or 2012 Server.

I know that VFP is obsolete, but I still have tens of applications out there and moving them to another platform is taking time...
Anybody experiences these problems ? what is the solution ?

I've got a FORM that is being used as a progress message window, to report stages in a lengthy piece of processing.
When the processing has finished, I click on the [x] close button. This calls the .QueryUnload() method, which asks a "do you want to close?" question.
If the answer is "Yes", then it calls THISFORM.Release().
But this doesn't close the FORM!
What am I doing wrong here?
I have an application using MSXML to retrieve data from a web site. On Successful receipt I 'PUT' an XML document to the web site confirming this and the data is cleared from the web site.

Subsequent retrievals then exclude documents previously downloaded.

However within the same application data session I am getting replicated downloads even though all objects related to the download are released after successful download and recreated each time a download process is started.

When I close and restart the application the correct data position is returned.
Microsoft have created a Printer Class described here

It gives the invocation syntax for C#, C++, F# and VB

Anyone know how to invoke it in VFP?
Hey guys,
I have a client who use a Visual FoxPro based program.  The program is contained in a shared folder that is shared from a server that all the users access.  This is everything that has happened with it:

The client recently migrated from SBS 2011 to a Server 2016 DC that was also doing file and print sharing. The program was then being hosted from the 2016 server.

The users reported all kinds of performance issues after going back and forth with the vendor I finally just spun up a Windows 7 VM and migrated the program (shared folder) to that.  I was told that though it was not working as well as it was before, it ran much better.

Now I have two Windows 10 users both of which are getting an "invalid seek offset," error.  The vendor told me that the error message means that there was a network drop and even what you research online says the same thing, however one user switched back to Windows 7 and never reported the error after that.  Also this same user who is now having this issue had Windows 7 before and was setup in the same cubicle as before. Also I ran utility called, "Ping for life," which a 100% ping success rate, which means no networking issues.

Right now I want to check with you guys, if there are any known issues with Visual Foxpro and the newer operating systems.  Any articles that say anything about this?
                var cdxExpressions = new List<CDXExpression> {
                new CDXExpression { expression = "ENTRY_DATE", name = "cdx_p1"},
                new CDXExpression { expression = "LOSS_PD", name = "cdx_p2"}

                string strCon =
                    @"Provider =vfpoledb;Data Source=C:\DBF_files_Folder\20180921\" + tableName + ".DBF"; // TestDataBase1.DBF";
                OleDbConnection con = new OleDbConnection(strCon);
                OleDbCommand cmd = con.CreateCommand();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "ExecScript";

                var myCode = "use " + tableName + " exclusive\n" +
                      string.Join("\n", cdxExpressions.Select(e => $"index on {e.expression} tag {}")) +

                cmd.Parameters.AddWithValue("code", myCode);
            catch (Exception ex)

C# -

Code above used VFPOLEDB driver. This driver should be installed on machine explicitly.
When I put my WPF application on common drive and ask users to access it, they also got to install VPFOLEDB. Is there a other than installing this MSI on all client machines.
Tried using JET OLEDB. It gives an error saying 'Cannot execute a Select Query'.

C++ 11 Fundamentals
LVL 13
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Our Desktop systems are written in VFP-9, and from time to time we have users reporting errors due to loss of connection to MSSQL (usually when the system is idle for a few minutes - a coffee break, for example). Until Windows 7, this problem no longer occurred by unchecking IPV6 and turning off the power-saving feature of the network card.

With Windows 10, we found that there are other places with the power saving feature such as monitor and HD. We have already cleared all this, but some users still report the same error (loss of connection).

Is there any way to avoid this loss of connection?

Translate from portuguese:

Os nossos sistemas Desktop são escritos em VFP-9 e, de uns tempos para cá, temos usuários reportando erros por perda de conexão com o MSSQL ( normalmente quando o sistema fica inativo por alguns minutos – uma pausa para o café, por exemplo ). Até o Windows 7, esse problema deixava de ocorrer desmarcando o IPV6 e desativando o recurso de economia de energia da placa de rede.

Com o Windows 10, descobrimos que existem outros lugares com o recurso de economia de energia, como monitor e HD. Já desmarcamos tudo isso, mas alguns usuários ainda reportam o mesmo erro ( perda de conexão ).

Tem alguma forma de evitar essa perda de conexão ?
I have this csv file which i want to convert into foxpro table.

The first row is a header, The second row is details.

Will like some advice on how to go about it.20180807_144846.csv

Thank you in advance.

Erick Nyange
I need to link an access database to what i think is a visual foxpro table the data is from an accounting program in foxpro
which is called Pegasus Opera version 2

I have managed to convert the table into a csv format then into MS ACCESS  but I could do with a live link if possible

Many Thanks

down vote
I am having a problem with seeks not working on descending indexes key values.

I set up my DBE as follows:



// Use server rights not user rights DbeInfo( COMPONENT_DATA, ADSDBE_RIGHTS_MODE, ADSDBE_IGNORERIGHTS )

I am connecting through an ADS data dictionary and the tables were added using the FoxPro (DBF/CDX) driver (not the Visual Foxpro driver.)

The indexes are created through ADS.

I have an index that puts empty dates first followed by descending dates then ascending IDs as:

Whenever I do a seek as either dbseek(descend(‘99999999’)) or dbseek(descend(dtos(dMyDate))) the seek goes to EOF or the proper record (date does exist) is not found properly.

I have the character set set to ANSI for both systems and the collation to Engl.(Amer) in both.

I've attached a sample program, table and other information in case anyone wants to take a look.
I have been coding Fox Pro for years as needed to perform what ever quant studies that I need to do which draw of a database.

I know I need to learn a new language for the future as FoxPro is really long gone.

What would you all suggest?  I need something that does all that FOX does and more I would hope.  A language that will be good for the next 20 years and is supported.

Thank You

I need to convert an application created in MS-DOS FoxPro2.6 to any new language programming keeping same features

or create a new one using its same ideas for the features

please anyone interested let me know
I have a VisualFoxPro (VFP) application being ported to a sqlserver backend.  The app has a memo field that contains more than 10,000 characters in come cases.  Using a varChar(max) causes a problem, the VFP view retrieves the data but there is an extra space between every character, doesn't really edit well, and will not update back to the server.  Is there a workaround or solution?
Date picker in FoxPro only fires on change event not click event if value chosen is the same as present value

( Microsoft date and time picker control 6.0 (SP4) )

if the user chose a date in the date picker then moves to a new record and chooses that same date, nothing is returned. Click event seems to not work, only onchange (actually change event on this control)  event which is not very functional.

Thanks :)
Good Afternoon Dear Experts.

I am trying to set up a VFP communication with a Webservice WSDL.
At the same time, I'm developing in .NET and I have the following code:

        Dim client As ISession2.Session2Client = New ISession2.Session2Client()
        Dim session As ISession2.SessionOpenResult = client.Open(Nothing, ISession2.WsRemoteClientTypes.WebserviceClient)
        If (session.ErrorMessage Is Nothing And session.SessionId IsNot Nothing And session.Status = "cmdDone") Then
            Dim logOnArgs As ISession2.SessionLogOnArgs = New ISession2.SessionLogOnArgs()
            logOnArgs.UserName = "WebService"
            logOnArgs.UserPassword = "password"
            logOnArgs.StationName = "WebService"
            logOnArgs.OwnerName = Nothing

            Dim logOn As ISession2.SessionLogOnResult
            logOn = client.LogOn(session.SessionId, logOnArgs)

            If (logOn.ErrorMessage = Nothing And logOn.Status = "cmdDone") Then
                Dim sessionID = New Guid(session.SessionId)
                Dim material = New IMaterial.MaterialClient()

                Dim getMaterialResult = material.MaterialExists(sessionID, "materialID")
                If (getMaterialResult IsNot Nothing) Then
                    MsgBox("material  found")
                    MsgBox("material not found")
                End If
                MsgBox("Error Log On: " & logOn.ErrorMessage)
            End If


Open in new window

Learn SQL Server Core 2016
LVL 13
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

VFP9 Expert----I know this is replied most of time. but this is little different. I have created a form with a container. During run time,  I need to add n number of command buttons in container by searching number of records (n)  in a cursor/table. After populating buttons, it should adjust the size within container. On clicking each button, it should show me record from cursor/table as a messagebox. I m developing software for a hotel. Imagine there is a dashboard type form on screen where the command button shows the room name and on clicking it I shall make either checkin or checkout the guest (this I can do it).
Since the number of rooms may vary it should be added during run time when I add rooms in a cursor or table.
Actually I have already done it by counter nos of command buttons needed, but every time I need to add programatically for any changes  in number of rooms.
i have  two  file having  same filed for  diff rant year  and  required  diff of filed no 6 to 17 on 3rd dbf
I've got a third-party conversion utility that I want to incorporate into my Visual FoxPro code (version 9.0 SP2).

Two of the parameters that I need to pass to this are non-standard types, which, in the Visual Basic example that comes with the documentation, have been declared as such, with the command

Public Type Coordinates
X As Double
Y As Double
Z As Double
End Type

How do I set this up in VFP?
I have a number of old word documents that I need to migrate to pdf but first I need to save them as DOCX but I want to save them without the Encryption password (which I have).

Anybody know how to do this?
VFP 9.0SP2 Word 2012

VFP hangs and then fails with with "error code 0x80080005:Server Execution Failed" when executing the line " loWord = CREATEOBJECT("Word.application")"

Worked in Word 2003.

Assistance appreciated

 LOCAL loWord, lcName, x, y
LOCAL loRange, loTable
#DEFINE wdCollapseEnd 0

* Start an instance of Word and open a document
loWord = CREATEOBJECT("Word.application")


Visual FoxPro (VFP), and its predecessor FoxPro, is a data-centric, object-oriented, procedural, database programming language and IDE from Microsoft last released in 2007 that still has some active use due to its low cost of deployment and fairly rapid development. In 2008, Microsoft released a set of add-ons for VFP's xBase components to allow interoperability with various Microsoft technologies. It allows data processing against its native file-based data tables or database servers such as SQL Server.

Top Experts In