Solved

Checking the connection string of a linked table

Posted on 2011-09-22
4
207 Views
Last Modified: 2012-06-27
How can I get the full connection string of a linked odbc table?

I would like to be able to evaluate the string in code, specifically the name of the server is what I am looking for.

The name of the table is t_companies.


Thanks
0
Comment
Question by:snyperj
  • 2
  • 2
4 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 36580441
run this query


select [name],connect
from msysobjects
where [name]="t_companies"
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 36580466
It's in the MSysObjects table. Give this a try:

 DLookup("Connect","MSysObjects","[Name]='t_companies'")

Or using a variable:

 DLookup("Connect","MSysObjects","[Name]='" & strTableName & "'")



0
 
LVL 61

Expert Comment

by:mbizup
ID: 36580504
<evaluate the string in code>

I was assuming that you wanted this in VBA...

Also take a look at Jim Dettman's article on DLookup and the Domain functions for this sort of requirement:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_12-Dlookup-and-the-Domain-Functions.html
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 36580643
;-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now