The amazing disappearing VBA code

  • Thread starter Thread starter Chuck
  • Start date Start date
We do disable the "Compact On Close" and the "Perform Name AutoCorrect"
options, however, I have to check on the "Compile On Demand". As far as
drive mapping problems over the last five years, how do you avoid it when
you have over a 1000 people on an installation that need files across a
network?
 
As far as
drive mapping problems over the last five years, how do you avoid it when
you have over a 1000 people on an installation that need files across a
network?

Use the stable and reliable \\server\path\filename syntax for linked tables
(and other network accesses) rather than assuming that the K: drive reliably
points to it.
 
As far as
drive mapping problems over the last five years, how do you avoid it when
you have over a 1000 people on an installation that need files across a
network?

Use the stable and reliable \\server\path\filename syntax for linked tables
(and other network accesses) rather than assuming that the K: drive reliably
points to it.
 
Nope, I have examples of the code disappearing where I have the "Compact on
close" turned on, and where it is turned off. Makes no difference. If
anything, it seems more stable with the switch turned on.
 
Nope, I have examples of the code disappearing where I have the "Compact on
close" turned on, and where it is turned off. Makes no difference. If
anything, it seems more stable with the switch turned on.
 
AccessVandal via AccessMonster.com said:
Still, why use drive mappings when they are lots of posting on these problems
in the past 5 years?

What? I'm unaware of any problems with drive mappings these past 5
years. Could you explain more?

Now if you are talking drive mappings vs UNC paths that's an argument
with 7 reasons on one side and 5 reasons on the other side.

Tony
 
AccessVandal via AccessMonster.com said:
Still, why use drive mappings when they are lots of posting on these problems
in the past 5 years?

What? I'm unaware of any problems with drive mappings these past 5
years. Could you explain more?

Now if you are talking drive mappings vs UNC paths that's an argument
with 7 reasons on one side and 5 reasons on the other side.

Tony
 
Now if you are talking drive mappings vs UNC paths that's an
argument with 7 reasons on one side and 5 reasons on the other
side.

I have to pull a bunch of Word files out of OLE link fields for a
new client. The links are stored as UNC paths even though the users
all have mapped drives.

It makes perfect sense that the OLE link path would be resolved to
UNC, because that's the only way you can guarantee that the document
will be openable by everyone. The design makes perfect sense to me,
since different machines might have different drive mappings.
Obviously, a well-run IT shop will have the same logon scripts and
drive mappings for everyone, but I think it's better not to assume
that.

I stopped using mapped drives in 1998.
 
Now if you are talking drive mappings vs UNC paths that's an
argument with 7 reasons on one side and 5 reasons on the other
side.

I have to pull a bunch of Word files out of OLE link fields for a
new client. The links are stored as UNC paths even though the users
all have mapped drives.

It makes perfect sense that the OLE link path would be resolved to
UNC, because that's the only way you can guarantee that the document
will be openable by everyone. The design makes perfect sense to me,
since different machines might have different drive mappings.
Obviously, a well-run IT shop will have the same logon scripts and
drive mappings for everyone, but I think it's better not to assume
that.

I stopped using mapped drives in 1998.
 
In our case, the computers are made to a specific standard, each having the
same configuration as the next. It is against policy to use any other
storage media besides what is already installed. The mapping script is
executed at NETLOGON time so everyone gets a drive mapped with the letter
"G" and the letter "H". There is also a shared drive for personal use with
a letter "Y". There is even one with an "X" for secured storage of
documents. This mapping has been this way for over 10 years now and we
never had any conflicts. Not every user is computer saavy and will know how
to map drives on their own or even know what a UNC is and how to enter into
an explorer window.

I have tried both ways to link tables together and both have worked as
designed. Although the situation of the VBA code being deleted sounds rare,
based upon several postings, it does indeed happen. And from our standpoint
at work, it is related to the attempt of opening the database prior to the
mapping script being completed. Since users are now using a script to check
for the existence of the mapped drives and then executes Access to open the
database, we have not had any problems. I don't think this is 100%
foolproof.
 
In our case, the computers are made to a specific standard, each having the
same configuration as the next. It is against policy to use any other
storage media besides what is already installed. The mapping script is
executed at NETLOGON time so everyone gets a drive mapped with the letter
"G" and the letter "H". There is also a shared drive for personal use with
a letter "Y". There is even one with an "X" for secured storage of
documents. This mapping has been this way for over 10 years now and we
never had any conflicts. Not every user is computer saavy and will know how
to map drives on their own or even know what a UNC is and how to enter into
an explorer window.

I have tried both ways to link tables together and both have worked as
designed. Although the situation of the VBA code being deleted sounds rare,
based upon several postings, it does indeed happen. And from our standpoint
at work, it is related to the attempt of opening the database prior to the
mapping script being completed. Since users are now using a script to check
for the existence of the mapped drives and then executes Access to open the
database, we have not had any problems. I don't think this is 100%
foolproof.
 
Not every user is computer saavy and will know how
to map drives on their own or even know what a UNC is and how to
enter into an explorer window.

That's because you've been providing them with mapped drives!

I provide support and Access programming to small businesses. My
first Access client to get an NT server was back in 1998. I knew
about networking already from working in a few other environments,
and knew how UNC worked. I was not originally their server admin,
but I was responsible for all their workstations. I set them up with
appropriate shortcuts on the desktop and trained them how to
navigate Network Neighborhood (this was pre-Windows 2000, which
introduced "My Network Places"). They had not difficulty navigating
this way at all.

But, one important thing:

When they got the server, we sat down and had several meetings to
design the structure of how data would be stored on the file server
and what user groups and security levels would be implemented. The
key is to have a a half dozen distince top-level shares, rather than
sharing the root of a data folder on the server. It's much easier to
get to your data if you have, say Administrative, UserData,
PublicData, ClientData, and so forth as your top-level shares,
instead of having to navigate to the root of drive and then drill
down to those folders.

Now, the organization of the data on the file server's hard drive
was completely different than what was presented to the users. The
key point is that you organize the hard drive for security, backup
and system administration purposes, and then design your shares to
reflect user needs for access.

Most shops I've been in have taken no care at all in designing the
shares presented to the users. There's also the problem of Windows
Server presenting a whole bunch of visible shares that are not for
end users (such as Exchange and so forth). That problem has
increased since the days of NT 4 Server, so it does make things
harder in terms of the top-level server view being crowded with a
bunch of shares that are not of interest to the end users.

The key point was that we organized the server and shares to reflect
the way the users wanted to have their work organized, and then
trained them on how to use UNC paths and how to navigate the server
and its shares in Windows Explorer. After only a few weeks, the
users all understood the system and had no difficulties whatsoever.

And we didn't have to worry about maintaining any logon scripts.
I have tried both ways to link tables together and both have
worked as designed. Although the situation of the VBA code being
deleted sounds rare, based upon several postings, it does indeed
happen. And from our standpoint at work, it is related to the
attempt of opening the database prior to the mapping script being
completed. Since users are now using a script to check for the
existence of the mapped drives and then executes Access to open
the database, we have not had any problems. I don't think this is
100% foolproof.

That sounds to me like a network configuration error. The logon
script that maps the drives should be executing long before the
users have any possibility of loading any applications. At least, in
all the environments I've worked in (which is pretty extensive now,
more than 10 years after my first heavy-duty Windows networking
experience), the logon scripts run before the desktop even populates
with its shortcuts. And they run just after the TaskBar and start
menu button appear, but before the start menu actually responds to
mouse clicks.

Something sounds odd there to me.

But, at least you've come up with a solution. I can't quite figure
out *why* it would be the solution, but the longer I'm in this
business the more I realize that the systems we work with are so
complex that more and more I am willing to try "voodoo"
troubleshooting, i.e., doing things that logically don't have any
connection to the problem, but that sometimes solve the problem
anyway.

I'm not yet sacrificing chickens and sprinkling their blood over the
servers, but I'm on track in that direction! ;)
 
Not every user is computer saavy and will know how
to map drives on their own or even know what a UNC is and how to
enter into an explorer window.

That's because you've been providing them with mapped drives!

I provide support and Access programming to small businesses. My
first Access client to get an NT server was back in 1998. I knew
about networking already from working in a few other environments,
and knew how UNC worked. I was not originally their server admin,
but I was responsible for all their workstations. I set them up with
appropriate shortcuts on the desktop and trained them how to
navigate Network Neighborhood (this was pre-Windows 2000, which
introduced "My Network Places"). They had not difficulty navigating
this way at all.

But, one important thing:

When they got the server, we sat down and had several meetings to
design the structure of how data would be stored on the file server
and what user groups and security levels would be implemented. The
key is to have a a half dozen distince top-level shares, rather than
sharing the root of a data folder on the server. It's much easier to
get to your data if you have, say Administrative, UserData,
PublicData, ClientData, and so forth as your top-level shares,
instead of having to navigate to the root of drive and then drill
down to those folders.

Now, the organization of the data on the file server's hard drive
was completely different than what was presented to the users. The
key point is that you organize the hard drive for security, backup
and system administration purposes, and then design your shares to
reflect user needs for access.

Most shops I've been in have taken no care at all in designing the
shares presented to the users. There's also the problem of Windows
Server presenting a whole bunch of visible shares that are not for
end users (such as Exchange and so forth). That problem has
increased since the days of NT 4 Server, so it does make things
harder in terms of the top-level server view being crowded with a
bunch of shares that are not of interest to the end users.

The key point was that we organized the server and shares to reflect
the way the users wanted to have their work organized, and then
trained them on how to use UNC paths and how to navigate the server
and its shares in Windows Explorer. After only a few weeks, the
users all understood the system and had no difficulties whatsoever.

And we didn't have to worry about maintaining any logon scripts.
I have tried both ways to link tables together and both have
worked as designed. Although the situation of the VBA code being
deleted sounds rare, based upon several postings, it does indeed
happen. And from our standpoint at work, it is related to the
attempt of opening the database prior to the mapping script being
completed. Since users are now using a script to check for the
existence of the mapped drives and then executes Access to open
the database, we have not had any problems. I don't think this is
100% foolproof.

That sounds to me like a network configuration error. The logon
script that maps the drives should be executing long before the
users have any possibility of loading any applications. At least, in
all the environments I've worked in (which is pretty extensive now,
more than 10 years after my first heavy-duty Windows networking
experience), the logon scripts run before the desktop even populates
with its shortcuts. And they run just after the TaskBar and start
menu button appear, but before the start menu actually responds to
mouse clicks.

Something sounds odd there to me.

But, at least you've come up with a solution. I can't quite figure
out *why* it would be the solution, but the longer I'm in this
business the more I realize that the systems we work with are so
complex that more and more I am willing to try "voodoo"
troubleshooting, i.e., doing things that logically don't have any
connection to the problem, but that sometimes solve the problem
anyway.

I'm not yet sacrificing chickens and sprinkling their blood over the
servers, but I'm on track in that direction! ;)
 
David W. Fenton said:
It makes perfect sense that the OLE link path would be resolved to
UNC, because that's the only way you can guarantee that the document
will be openable by everyone.

Until the IT department changes the name of the server. That's one of
the five reasons. <smile>

Tony
 
AccessVandal via AccessMonster.com said:
Back than, even a basic office setup without servers, the mapped drives does
not work all the time. You’ll have to create a logon script to make sure that
the mapped drives are connected correctly to the drive letter as what the OP
had done.

Sure, that's standard stuff when it comes to drive letters as far as
I'm concerned.
There’s too many mapped drive problems to be listed here. Could be memory,
BIOS, mainboard IRQ, software like Anti-Virus, FireWall…etc.

Umm, well not so sure about the above reasons. Although someone
attaching a multi card reader to USB adapter can add a bunch of drive
letters in a few seconds.
As far as I know, mapped drive letters are automatically assigned by the OS
and on a first come first serve basis. If you do not have a script to delete
the mapped drive, the next time the OS reboots, the mapped drive letter might
not be the same or mapped to the wrong share folder.

Sure but the script should be taking care of all those things for you.

Tony
 
Until the IT department changes the name of the server. That's
one of the five reasons. <smile>

But that doesn't happen very often,

And if it does, you can override it in the HOSTS file, i.e., mapping
the new IP address to the old name, which will be used instead of
asking your local DNS or WINS server to resolve the name to an IP
address.
 
David W. Fenton said:
But that doesn't happen very often,

And if it does, you can override it in the HOSTS file, i.e., mapping
the new IP address to the old name, which will be used instead of
asking your local DNS or WINS server to resolve the name to an IP
address.

Which means distributing the new HOSTS file. <shudder>

Tony
 
Which means distributing the new HOSTS file. <shudder>

Any IT infrastructure I'm in charge of replaces a server with a new
server of the exact same name. That means it has to be done outside
regular office hours, for something that elaborate, usually on a
weekend.

Mapped drives are ridiculous. They've been outdated forever.

But changing server names is just something that oughtn't happen,
ever.
 
Which means distributing the new HOSTS file. <shudder>

I could also be done with DNS entries from your network's local DNS
server (yes, I know that's redundant). You just point two server
names to the same IP address.

There really isn't any reason to map drives.
 
Until the IT department changes the name of the server.  That's one of
the five reasons.  <smile>

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages -http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/
Granite Fleet Managerhttp://www.granitefleet.com/

And I've just been through that - it turned out we needed to keep both
servers online for an extended period after we installed a new server
- ugly all the way around.

And to get back to the topic at hand, I've just seen the problem the
original poster raised - on a complex Access front-end with lots of
VBA - and yes it is split, and deployed to each workstation - but this
happens to be the development copy! I'm hopeful that I have a good
backup from last night, but I can't restore it until tomorrow as the
server is some 800 miles from me and unattended outside normal working
hours. The environment is Windows Server 2008 with Access 2007 SP2.

I've heard others report this problem, but have not experienced it
myself until tonight. Something appears to be going on, and I see
several recent reports of it on other forums.

Wendell
 
Back
Top