Solved

VB to Foxpro

Posted on 2000-04-10
3
214 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

696 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