Solved

Checking the connection string of a linked table

Posted on 2011-09-22
4
209 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36580643
;-)
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

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…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

777 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