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

Export from Visual Fox Pro into Access

Status
Not open for further replies.
Jul 14, 2003
3
US
I am trying to export information into Access from Visual Fox PRo using a module in Access so all data will be imported automaticaly with the click of a button. I created a foxpro object in Access and then proceeded with the commands that I used in foxpro to get the data manually but it just keeps running and never fully executes the query. Can anyone help me with my code. Here is what I have so far.

Dim fox As Object
Set fox = CreateObject("VisualFoxPro.Application")
fox.DoCmd ("set path to i:\ipc\vdata")
fox.DoCmd ("set excl off")
fox.DoCmd ("MODIFY QUERY \\ipc\d_drv\ipc\vdata\production_query.qpr")
fox.DoCmd ("Do \\ipc\d_drv\ipc\vdata\production_query.qpr")

Thanks for you help
 
I Think that you cannot view a Foxpro table in Access 97 (I do not know about later versions).

However Queries produce wonderful results.

create a module and Run DoCmd.RunSql "make table query" and you will have all your results in the Access Table that was created.
 
I'm not sure I understand. I have the table created and I'm going to pull the data from a text file I created after I manipulate the data. I want to create a command in Access that will open the VFP and run the query and export it. I am open to suggestions about how to export but it needs to be automatic and it has to go to a text file before the access table. I am pulling over data everyday and the data will append to the table- I don't need the make table command everyday
 
If you have a text file where does FoxPro come into the picture.

Where are you storing the information from the text file in Access or in FoxPro.

If you want to transfer it to Access run in a Module DoCmd.TransferText and import the information into Access.

remember you need to create a spec manually before hand so that access knows how to read your text file.

I don't think I understand exactly what you wnat to do, please clarify.
 
I already have the code set up for the transfer text. What I want to do is be able to go across platforms, into VFP and click a button that will run the query and export the information into a text file, but I want it to look like one application so I thought it could be done in Access using an VFP object. I also thought of clicking a button in access that will open a form in VFP that I can then click on to export. That form works but I just can't bring the form up from Access. I hope this makes sense.
 
I think what you are saying is, you want to use Access as a front end to import information into FoxPro.

I am not that well versed in FoxPro.

I have a suggestion which I am almost sure works.

Import the text file into an Access table and then run a append query to FoxPro Table on the information you imported.

If you don't want the information in Access delete the object after you appended the information.

I hope this helps;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top