|
-
Mar 18th, 2007, 07:02 AM
#1
Thread Starter
Fanatic Member
open access application from VBA
Hi,
I have an ms access project that is divided into 2 parts:
1. back end- only the database tables.
2. front end- all the forms/reports/ query. the database is connected as link tables to the back end file.
I'd like to replace the current back end file with an upadted back end file from a button in the front end.
basically what I need to do is:
1. disconnect the (current) back end tables - any ideas how?
2. replace the back end file (simple copy command)
3. reconnect to the (new) back end tables - any ideas how?
or maybe you have suggestions to do this in another way?
thanks,
-
Mar 18th, 2007, 11:49 PM
#2
-
Mar 19th, 2007, 12:51 AM
#3
Hyperactive Member
Re: open access application from VBA
Using ADO, I know you can cycle through the collection of tables and reset/update/refresh the connection string for each table.
You'd have to use a KILL command in code to delete your backend (easy if there is no file lock)
Use a copy (filecopy?) command to replace the backend
Then cycle through your collection of tables and refresh each link, or if you're lucky, find a single "refresh all linked tables" statement but I don't think there is one.
Rate my response if I helped
Go Hard Or Go Home
-
Mar 19th, 2007, 06:58 AM
#4
Thread Starter
Fanatic Member
Re: open access application from VBA
well, I think I can focus now on 2 problems:
1. lock problem- is there a way to release a locked mdb?
2. cycle through your collection of tables and refresh each link- how do I do that? do you have any sample code or link that shows how to do that?
thanks,
-
Mar 21st, 2007, 01:03 AM
#5
Hyperactive Member
-
Mar 21st, 2007, 03:07 AM
#6
Thread Starter
Fanatic Member
Re: open access application from VBA
Hi Nagasrikanth,
thank you! it looks good, I'll give it a try.
could you please show sample code how to reconnect the database?
thanks,
-
Mar 21st, 2007, 04:33 AM
#7
-
Mar 21st, 2007, 04:39 AM
#8
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|