Relinking tables to a network server

E

ecovindaloo

I'm trying to relink tables using code to a network server. The problem is
that the users all have different letters for their server. I'm using the
following code:

Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim b As Boolean
Dim strPath As String

Dim dbPath As String
Dim dbname As String

On Error GoTo RelinkTables_Error

b = True

Set db = CurrentDb

dbname = "AboveDB_be.mdb"

dbPath = "\\eastfps00\accesswork\"

strPath = dbPath & dbname
'strPath = DB_PATH & DB_NAME


'Relink each table's connection string
For Each tdf In db.TableDefs

Call SysCmd(acSysCmdSetStatus, "Checking " & tdf.Name & " ...")

If (tdf.Attributes And dbAttachedTable) = dbAttachedTable Then
If Left(tdf.Connect, 7) = "Paradox" Then
'Just ignore the link because it's a Paradox table.
Else
Call SysCmd(acSysCmdSetStatus, "Relinking " & tdf.Name & " ...")

'tdf.Connect = ";" & strPath
tdf.Connect = ";DATABASE=" & strPath
tdf.RefreshLink
End If
End If
Next

I thought that by using two slashes at the front this gets around the problem
of having different network drive letters. But I get an error message and it
doesn't relink the tables.

Any ideas how to get around this problem?
 
A

Arvin Meyer [MVP]

Perhaps a simplistic answer, but do you have NetBIOS enabled on all the
machines? The UNC (Universal Naming Convention) that you want to use depends
upon it.
 
D

Douglas J. Steele

Drive letters are always mapped to a share on a server. If, say, they'rr
using a mapped drive of L:, is the drive mapped to
"\\eastfps00\accesswork\", or are you expecting that the application will be
in L:\\accesswork\?
 
E

ecovindaloo

This I'm not sure of. How do I check for this?
Perhaps a simplistic answer, but do you have NetBIOS enabled on all the
machines? The UNC (Universal Naming Convention) that you want to use depends
upon it.
I'm trying to relink tables using code to a network server. The problem
is
[quoted text clipped - 47 lines]
Any ideas how to get around this problem?
 
E

ecovindaloo

It would be mapped to L: and this directory \\eastfps00\accesswork\. So the
mapped letter can be different for each user. I thought using "\\" bypasses
having to use the mapped drive letter.
Drive letters are always mapped to a share on a server. If, say, they'rr
using a mapped drive of L:, is the drive mapped to
"\\eastfps00\accesswork\", or are you expecting that the application will be
in L:\\accesswork\?
I'm trying to relink tables using code to a network server. The problem
is
[quoted text clipped - 47 lines]
Any ideas how to get around this problem?
 
D

Douglas J. Steele

Yes, using a UNC does bypass the need to have a mapped drive letter. I was
just trying to ensure that you were supplying the correct information for
the Connect property.

Double-check that what's in strPath is what you think it should be. If you
enter that value into a Run command, does the database open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


ecovindaloo said:
It would be mapped to L: and this directory \\eastfps00\accesswork\. So
the
mapped letter can be different for each user. I thought using "\\"
bypasses
having to use the mapped drive letter.
Drive letters are always mapped to a share on a server. If, say, they'rr
using a mapped drive of L:, is the drive mapped to
"\\eastfps00\accesswork\", or are you expecting that the application will
be
in L:\\accesswork\?
I'm trying to relink tables using code to a network server. The problem
is
[quoted text clipped - 47 lines]
Any ideas how to get around this problem?
 
E

ecovindaloo

I pasted that into the Run command and I received an error message that it
couldn't find the network path. I'm going to try this at home tonight. I
have a virtual drive and I will see if that works and I'll let you know.

Thanks for all the help.
Yes, using a UNC does bypass the need to have a mapped drive letter. I was
just trying to ensure that you were supplying the correct information for
the Connect property.

Double-check that what's in strPath is what you think it should be. If you
enter that value into a Run command, does the database open?
It would be mapped to L: and this directory \\eastfps00\accesswork\. So
the
[quoted text clipped - 13 lines]
 
A

Arvin Meyer [MVP]

Each OS is a bit different. Try opening a Help window and typing "NetBIOS".
Generally, your network admin (or whomever set up your network) will know if
NetBIOS has been turned off.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


ecovindaloo said:
This I'm not sure of. How do I check for this?
Perhaps a simplistic answer, but do you have NetBIOS enabled on all the
machines? The UNC (Universal Naming Convention) that you want to use
depends
upon it.
I'm trying to relink tables using code to a network server. The problem
is
[quoted text clipped - 47 lines]
Any ideas how to get around this problem?
 
E

ecovindaloo via AccessMonster.com

Doug,

I was able to figure out the correct way to get the directory path. I was
using \\eastfps00\accesswork\ but it should have been \eastfps00\pro2\
accesswork\.

Pasting this into the run command helped me to figure it out. I had
forgotten about doing it that way. Thanks for the idea.

And thanks again thanks for the quick help with this problem.

Joe
Yes, using a UNC does bypass the need to have a mapped drive letter. I was
just trying to ensure that you were supplying the correct information for
the Connect property.

Double-check that what's in strPath is what you think it should be. If you
enter that value into a Run command, does the database open?
It would be mapped to L: and this directory \\eastfps00\accesswork\. So
the
[quoted text clipped - 13 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top