Change location of MS Access Database

I have a project that I want someone to choose if they want to look at the network database or their local database on the drive, how do i change the location of the database so that someone can choose which database they look at each time they access the program.  I did not define the database via program commands i defined them through the properties of the ole data object.  I am a rookie to VB so be gentile.
skip0464Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

QJohnsonCommented:
You must have the path and file name of the database as part of your connection string or you couldn't get a connection to ANY database, right?

You can let them choose any database they want if you give them a way to supply the path and name.  They might use a textbox (easiest for YOU - hard for them) or by using the common file dialog (harder for you - REALLY REALLY easy for them).

But, if you only want to offer a choice between two known databases and aren't interested in ANY OTHER databases, why not just offer a dialog with a pair of radio buttons and let them click on the one they want.

Then your code can just open the one related to their choice, right?
0
skip0464Author Commented:
I tried to do the radio button, but when i try to update the databasename property it does not seem to work, i am sure i am missing something simple, but after someone selects the radio button i tried to change the databasename property.  if my choices are M:\mailing or c:\project\mailing.mdb what would the syntax be to update the correct property.  
0
QJohnsonCommented:
Please post your code.  I'll be happy to make changes to it.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

skip0464Author Commented:
I create an OLE object and adjust the properties: CONNECT is ACCESS 2000, DATABASENAME is M:\MAILING.MDB and RECORDSOURCE is MARKETING.  when i want to change the point to point locally i execute the statement:

dtamarketing.databasename = "C:\project\mailing.mdb"

dtamarketing is the ole object

so there is almost no code to access the database.
0
JH0401Commented:
dtamarketing.databasename = "C:\project\mailing.mdb"
dtamarketing.refresh
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
skip0464Author Commented:
Thanks, in the startup module i ask the question "do you want to connect to the network" and set the properties and do a refresh and it works.
0
skip0464Author Commented:
this is the best site for vb info.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.