Solved

VB to Foxpro

Posted on 2000-04-10
3
206 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
Comment Utility
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
Comment Utility
Thanks very much.
0
 
LVL 2

Expert Comment

by:Crin
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now