Link to home
Start Free TrialLog in
Avatar of mullykid
mullykid

asked on

Access Forms - Changing Shared Link Data Source

Hi,

I wish to distribute my access forms to customers who do not have MS Access, i.e. they will execute them via the run time library.

My forms contain links to SQL Server DB tables only. These links need to be changed per customer during configuration/installation. The table names will be the same, but the host name, DB user, DB name may not.

Please tell me this is possible! I can't find out how to it. Do I need to create a form to handle it?

TIA!

Iain
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

You just need a button to open the linked tables manager..

Private Sub Command0_Click()
DoCmd.RunCommand acCmdLinkedTableManager
End Sub
Avatar of mullykid
mullykid

ASKER

Thanks Peter.

When I run it inside access it works.

When I run it via the run time library though it crashes. Do you know why? This is where I need it to work.

Hi,

It appears this is not a run time feature, and other code is required.
Didn't realise this was regarded as a 'design' feature.

It's a lot of code then.
Here is a standard approach.

http://access.mvps.org/access/tables/tbl0010.htm

Hi,

This appears to be for Oracle ODBC. Anything for SQL Server?
Hi,

I think I may do this. Create a form so that the DBName, Server, user name and password etc. can be configured/entered by the user  (at install time for example) and then store this data and update the connection string for each Link table.

Can you show me how I would update the connection string with such variables?
I just answered something very similar.
https://www.experts-exchange.com/questions/27381763/Looking-for-code-to-change-filepath-for-all-linked-tables-from-various-sources-for-multiple-databases.html?cid=1572&anchorAnswerId=36920121#a36920121
Have a look and post if you wind up in the weeds.

TEST with the run-time.
The run-time is designed to be unhappy with design changes.
What works full blown may not work run-time, so TEST in that environment
Hey Nick. Thanks for your reply.

The link doesn't seem to work. It loads a blank page. Can you give me your suggestion?
ASKER CERTIFIED SOLUTION
Avatar of Nick67
Nick67
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dude, thanks a million. Finally a sensible way of doing this.