473,378 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Run a program file in Visual Foxpro using VB.NET

I have a abc.PRG file in visual foxpro 8.0. I can run this file using visual
foxpro environment and it creates a table X.dbf in the same folder where this
program file is and populates some data in the table.
I want a way to run this abc.PRG file through VB.net environment.
(Equivalent method to perform same as "DO abc.prg" command in foxpro).
Please help me. Thanks in advance.
Nov 21 '05 #1
3 9824
Hi Amar,

If you can figure out the string that runs the program - eg,
"c:\fox\foxpro.exe abc.prg" - then you can call it like this:

Dim psi As New ProcessStartInfo

psi.UseShellExecute = True

psi.FileName = "c:\fox\foxpro.exe abc.prg"

Process.Start(psi)

But bear in mind that this is using the services of foxpro to run the .prg
file - and I don't think there is any way you can avoid this - in other
words, you would have to install foxpro on any machine that runs this prg
file.

HTH,

Bernie Yaeger

"Amar" <Am**@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
I have a abc.PRG file in visual foxpro 8.0. I can run this file using
visual
foxpro environment and it creates a table X.dbf in the same folder where
this
program file is and populates some data in the table.
I want a way to run this abc.PRG file through VB.net environment.
(Equivalent method to perform same as "DO abc.prg" command in foxpro).
Please help me. Thanks in advance.

Nov 21 '05 #2
Hi Amar,

Here's another way, and as Bernie said, this assumes VFP is installed on the
machine. Otherwise you'll need a VFP exe and the appropriate runtimes
installed.

'-- Add a reference to the Visual FoxPro Type Library
'-- I'm using VFP 9 so the reference points to
'-- C:\Program Files\Microsoft Visual FoxPro 9\VFP9.exe
'-- Assume program TestAutomation.prg in C:\Temp

Module Module1
Sub Main()
'-- Intellisense with bring up the VFP properties and methods
Dim Fox As New VisualFoxpro.FoxApplication
Fox.DefaultFilePath = "C:\Temp"
Fox.DoCmd("Do TestAutomation.prg")
End Sub
End Module

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
ci**************@msn.com www.cindywinegarden.com
"Amar" <Am**@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
I have a abc.PRG file in visual foxpro 8.0. I can run this file using
visual
foxpro environment and it creates a table X.dbf in the same folder where
this
program file is and populates some data in the table.
I want a way to run this abc.PRG file through VB.net environment.
(Equivalent method to perform same as "DO abc.prg" command in foxpro).
Please help me. Thanks in advance.

Nov 21 '05 #3
Thank you Cindy. You are my hero!!
Bernie thank you so much too. Both of your are awesome. Thanks again!!

"Cindy Winegarden" wrote:
Hi Amar,

Here's another way, and as Bernie said, this assumes VFP is installed on the
machine. Otherwise you'll need a VFP exe and the appropriate runtimes
installed.

'-- Add a reference to the Visual FoxPro Type Library
'-- I'm using VFP 9 so the reference points to
'-- C:\Program Files\Microsoft Visual FoxPro 9\VFP9.exe
'-- Assume program TestAutomation.prg in C:\Temp

Module Module1
Sub Main()
'-- Intellisense with bring up the VFP properties and methods
Dim Fox As New VisualFoxpro.FoxApplication
Fox.DefaultFilePath = "C:\Temp"
Fox.DoCmd("Do TestAutomation.prg")
End Sub
End Module

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
ci**************@msn.com www.cindywinegarden.com
"Amar" <Am**@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
I have a abc.PRG file in visual foxpro 8.0. I can run this file using
visual
foxpro environment and it creates a table X.dbf in the same folder where
this
program file is and populates some data in the table.
I want a way to run this abc.PRG file through VB.net environment.
(Equivalent method to perform same as "DO abc.prg" command in foxpro).
Please help me. Thanks in advance.


Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: V.V. Singh | last post by:
Hi Everyone, This is my code for making a connection to a Visual FoxPro free table and querying it. I get the following error message File iddxstrippunc.prg does not exist I have tested...
1
by: GPBSOFT | last post by:
I am Italian developer, escuse me for my bad English I have a problem with ODBC. I must link to a database from Visual FoxPro, I have installed Windows XP Professional with service pack 2. When I...
2
by: Rachel | last post by:
I am developing an application on Visual Foxpro 7. I would like to inculde some .NET functions in it. For this purpose I have created a dll in VC++ .net using managed c++. I have written all the...
9
by: cj | last post by:
I'm trying to forge ahead with Visual Basic .Net but recently I've suffered several major set backs in demonstrating VB is the future and we should move from Visual FoxPro. I really need to find...
0
by: xscope | last post by:
Hi, I don't know if this is the correct group to post this. I have the following enviroment :- Server A - Windows 2000 Server SP4 - Running Business Objects Enterprise 11 Server B -...
0
by: AJIT PITALE | last post by:
Hi, I am using Visual Basic 6 as front end and Visual FoxPro as a Database. I am trying to pass a parameter from VB to Visual FoxPro's Stored Procedure. I am getting an error showing "Data...
1
by: cecilchamp | last post by:
I have already set up a Visual FoxPro Remote View to connect to an MS ACCESS Database, but I continually have an OPEN FILE Dialog Box pop up looking for the MS ACCESS MDB file that I had already...
1
by: HR Head | last post by:
Dear All, Fresh Programmers Required Urgently Visual Foxpro / VB / .NET Skill set required :- Visual Foxpro 1 or 2 years Experince Location:- Malaysia / Singapore Qulification ;- Any...
3
by: HistoricVFP | last post by:
Hello, I’ve been given the task of importing .dbf files from a very old version of Visual FoxPro (version 2.1) into Access (2003). When I import the data straight to Access it errors with: ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.