Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB to Foxpro

Posted on 2000-04-10
3
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
Crin earned 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…
Suggested Courses

636 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