473,395 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Question about remote mdb files

Hi all,

I am happy using the CurrentDB() reference to identify the local path
to my open database, but how do i programatically find the path to a
remote database? specifically, the database that i have my linked data
stored in?

Many thanks,

Rob.

Nov 13 '05 #1
3 1307
Br
dkintheuk <rm*******@firenet.uk.com> wrote:
Hi all,

I am happy using the CurrentDB() reference to identify the local path
to my open database, but how do i programatically find the path to a
remote database? specifically, the database that i have my linked data
stored in?

Many thanks,

Rob.


Check out the connection string of the database object....
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #2
"dkintheuk" <rm*******@firenet.uk.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi all,

I am happy using the CurrentDB() reference to identify the local path
to my open database, but how do i programatically find the path to a
remote database? specifically, the database that i have my linked data
stored in?

Many thanks,

Rob.

You need to get it from the connect property of the tabledef object, as in
the function below. Be aware that this function does not check that the
backend really exists, nor will it complain if you pass the name of a table
which is not a straight-forward link to another Access database. For
example, if you gave the name of a table linked to a SQL Server database or
the name of local (real not linked) table, then the function would simply
return a zero-length string.
Public Function BackEndDb(LinkTable As String) As String

On Error GoTo Err_Handler

Dim dbs As DAO.Database
Dim tdf As DAO.TableDef

Set dbs = CurrentDb

Set tdf = dbs.TableDefs(LinkTable)

If Left(tdf.Connect, 10) = ";DATABASE=" Then
BackEndDb = Mid$(tdf.Connect, 11)
End If

Exit_Handler:

On Error Resume Next

If Not tdf Is Nothing Then
Set tdf = Nothing
End If

If Not dbs Is Nothing Then
Set dbs = Nothing
End If

Exit Function

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler

End Function
Nov 13 '05 #3
Justin Hoffman wrote:
"dkintheuk" <rm*******@firenet.uk.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Hi all,

I am happy using the CurrentDB() reference to identify the local path
to my open database, but how do i programatically find the path to a
remote database? specifically, the database that i have my linked data
stored in?

Many thanks,

Rob.

You need to get it from the connect property of the tabledef object, as in
the function below. Be aware that this function does not check that the
backend really exists, nor will it complain if you pass the name of a table
which is not a straight-forward link to another Access database. For
example, if you gave the name of a table linked to a SQL Server database or
the name of local (real not linked) table, then the function would simply
return a zero-length string.
Public Function BackEndDb(LinkTable As String) As String

On Error GoTo Err_Handler

Dim dbs As DAO.Database
Dim tdf As DAO.TableDef

Set dbs = CurrentDb

Set tdf = dbs.TableDefs(LinkTable)

If Left(tdf.Connect, 10) = ";DATABASE=" Then
BackEndDb = Mid$(tdf.Connect, 11)
End If

Exit_Handler:

On Error Resume Next

If Not tdf Is Nothing Then
Set tdf = Nothing
End If

If Not dbs Is Nothing Then
Set dbs = Nothing
End If

Exit Function

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler

End Function


Bingo! That was just what i was looking for - have altered to suit as
want path not full filename but that was an easy fix, cheers.

Rob.

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: lian | last post by:
Hi all, I have installed a web-based software written in php which needs that i should turn "register_globals" from off to on in the php.ini. There are some comments for register_globals in...
11
by: juglesh | last post by:
at one centraldomain.com, I have central.php, which consists of this: <?php function square($num) { return $num * $num; } ?> at outerdomain.com, I have test.php, which consists of this:...
5
by: steve | last post by:
Hi, I finally figured out the best way to synch local and remote script folders, containing many php script files. What I used to do before was try to ftp all the changed files, etc. which was...
3
by: Nick Bunton | last post by:
I have setup remote debugging on an NT4 workstation for testing. I then build from the debug config on my machine and copy all the files from the /bin/debug folder including the .PDB files. I then...
5
by: mayamorning123 | last post by:
A comparison among six VSS remote tools including SourceOffSite , SourceAnyWhere, VSS Connect, SourceXT, VSS Remoting, VSS.NET To view the full article, please visit...
1
by: No Spam | last post by:
Dear Access 2003 Users, Is there any way to launch Terminal Server from Access and pass along the user name that is in a text box? I believe mstsc.exe can be passed an IP address (/v), but can...
0
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed...
3
by: JV | last post by:
I'm trying to understand how ASP.NET creates web folders when it creates a new ASP.NET project. I am experienced with DotNet development, but not an expert on how IIS works. Or, this may be a...
7
by: D. Patrick | last post by:
I need to duplicate the functionality of a java applet, and how it connects to a remote server. But, I don't have the protocol information or the java source code which was written years ago. ...
6
by: Jim M | last post by:
I've been distributing a fairly mature, very specific MS Access application to end users in small offices of colleges for several years now. This is a part-time venture and low volume operation-...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.