Solved

VB to Foxpro

Posted on 2000-04-10
3
210 Views
Last Modified: 2010-05-02
I'm using VB to link a Foxpro database table to an Access table so I can copy the fields I need for the Access table from the Foxpro table. My problem is if the program is shut down in the middle of processing this information and then they try to run it again, an error comes up because the program is trying to link a table that already exists. How can I check to see if the linked table exists so I can delete it if it does? Also, is there some property to check to see if a command button was clicked in the middle of a procedure?
Thank you very much for your time,
0
Comment
Question by:Swordmaster
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Crin earned 100 total points
ID: 2702275
Hello Swordmaster,

the easiest way is to leave code as is but add some lines of code

1. At the begin of the sub add
On error goto Trapper

2. Before link creation insert line with number 10 (for example :)

3. at the end of sub (before End Sub) type:

Exit Sub

Trapper:

If Erl = 10 then
  'your code to remove link
  Resume 10
else
  msgbox "Another error."
end if

There are more accurate ways - this is just easiest workaround :))

Sincerely yours,

Crin
0
 

Author Comment

by:Swordmaster
ID: 2705269
Thanks very much.
0
 
LVL 2

Expert Comment

by:Crin
ID: 2705288
Hope my comments will help you now and in the future.

thanks for the points, I'm new on EE and this is interesting to me yet :))

Sincerely yours,

Crin
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question