473,841 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Locations of .dll files

I seem to remember reading somewhere that, if you do not include the .dll
path name in the VBA 'Declare Function' statement, Windows looks in the
following places for .dlls (in this particular order):

1)The MS Access executable directory
2)The current directory (i.e. the same dir as the .mdb)
3)windows\syste m32
4)other places... (maybe looks at the "path=" enviroment variable?)

Firstly, is this right?

If so, why is Access failing to find the .dll even though it is in the same
dir as the .mdb (case 2 above)?

If I move the .dll to windows\system3 2, it finds it no problem. If I specify
a path (e.g.:

Declare Sub xyzdll Lib "c:\foo\xyz.dll "

it works no problem.

But if I just leave it sitting in the same dir as the .mdb:

"Run time error '53': File not found"

I'm (pretty) sure that this used to work.

Any suggestions?
TIA

PS: Running MSAccess XP

--
Scott

Xbox Live Gamertag: scottmorrison
Xbox Live Games: Top Spin, PGR2, RS3, RTCW, CounterStrike, Tetris
Nov 12 '05 #1
2 5047
The current directory isn't necessarily the same as the directory where the
..mdb is located. To prove this, open your database, go to the Debug window,
type ?CurDir then hit enter.

What you'll get depends on how you opened the database. If you opened it by
double clicking on it, you'll get whatever's set as the Default Database
Folder (specified on the General tab under Tools | Options). If you opened
it by navigating to it through the File Open dialog, then it'll be the same.
If you opened it using a shortcut, you can set the current directory in the
shortcut.

One possibility (untested) would be to use ChDir to set the current
directory when you open the database.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)

"Scott" <no****@nospam. com> wrote in message
news:31dfc.1660 8$4N3.4580@news fe1-win...
I seem to remember reading somewhere that, if you do not include the .dll
path name in the VBA 'Declare Function' statement, Windows looks in the
following places for .dlls (in this particular order):

1)The MS Access executable directory
2)The current directory (i.e. the same dir as the .mdb)
3)windows\syste m32
4)other places... (maybe looks at the "path=" enviroment variable?)

Firstly, is this right?

If so, why is Access failing to find the .dll even though it is in the same dir as the .mdb (case 2 above)?

If I move the .dll to windows\system3 2, it finds it no problem. If I specify a path (e.g.:

Declare Sub xyzdll Lib "c:\foo\xyz.dll "

it works no problem.

But if I just leave it sitting in the same dir as the .mdb:

"Run time error '53': File not found"

I'm (pretty) sure that this used to work.

Any suggestions?
TIA

PS: Running MSAccess XP

--
Scott

Xbox Live Gamertag: scottmorrison
Xbox Live Games: Top Spin, PGR2, RS3, RTCW, CounterStrike, Tetris

Nov 12 '05 #2
On Apr 14 2004, 11:46 am, "Scott" <no****@nospam. com> wrote in
news:31dfc.1660 8$4N3.4580@news fe1-win:
I seem to remember reading somewhere that, if you do not include the .dll
path name in the VBA 'Declare Function' statement, Windows looks in the
following places for .dlls (in this particular order):

1)The MS Access executable directory
2)The current directory (i.e. the same dir as the .mdb)
3)windows\syste m32
4)other places... (maybe looks at the "path=" enviroment variable?)

Firstly, is this right?


Not quite. It doesn't look in the mdb's directory (which as Doug said is
not the same as the current directory). It looks in the application
directory. From Windows' point of view, this is where msaccess.exe is
located.

--
remove a 9 to reply by email
Nov 12 '05 #3

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

Similar topics

6
1910
by: Johnny van Cadsand | last post by:
Hi, I know how inheritance works. But do i have to put all the inherited class files in the same directory as the class file which inherits is in?? (VB.NET) When i have a baseclass which i want to use in different solutions, then i add the class to a solution. The IDE copies the file to the other solution folder and i have 2 copies of the same class file.
9
351
by: Nimmi Srivastav | last post by:
I have two questions: 1) What are the default directories in which the compiler looks for standard header files? 2) What are the default directories in which the linker looks for standard library files? Thanks, Nimmi
2
3172
by: Dan Baker | last post by:
I'm relatively new to the .cs world. I would like to have some "shared" .cs files, which several solutions can use. I don't want to place these in a ..dll, I simply want them included into various applications. I have tried several methods, but most have failed. The most obvious way (I thought) was to place the .cs files in a parent folder (maybe called "shared"), and then simply drag-n-drop the files into the "Solution Explorer" (files...
1
1504
by: JohnSouth | last post by:
Hi I've a C# application that needs to copy files between remote web locations (http:// or https://) I can copy XML files using WebRequest/WebResponse OK, but Word documents do not arrive as valid documents. The problem seems to be in ascii encoding. My question is can I use WebRequest/WebResponse to copy binary files? Is there a better way to copy these files?
0
1137
by: esha | last post by:
I'm learning WEB site stuff with C# and have a question. In order to produce precompiled application (dlls and required for a real hosting files) it's not enough to build the solution. It must be published. This process will create necessery files. I used to keep all data (including all VS projects) outside of my primary partition. I'm using Symantec Ghost to create an image of my working primary partition. In case I get some problem...
4
1082
by: John Dann | last post by:
Can anyone point me to a summary of recommended folder locations for ..Net applications to use for eg config files. (Or if it's simple just spell them out please.) I'm currently saving my programs' config and template files to the application folder, which I'm sure has been deprecated for some time but is maybe going to become more difficult under Vista? JGD
0
1266
by: eholz1 | last post by:
Hello PHP group, I have a question about file locations, and whether on not (in my case, not) a page will execute depending on the location of the php file. I have a web devel server, with a directory below htdocs (using Apache 2.2 on Fedora Linux) /usr/local/apache2/htdocs/portfolios and /usr/local/apache2/htdocs/ portfolios/setup
4
2260
by: oldeast | last post by:
Hi all, Read the posts about the trust centre, has anyone else encountered this? I've set up a trusted location for my front end, and that works OK on my development folder. I changed the trust centre folder for the distributed copy. The copy and any copy on the user's machine ignores the trusted location and requires the user to enable the content. I've tried deleting and re-entering the trusted location, any suggestions?
2
1197
by: seagullino | last post by:
Hi, I'm hoping that someone can point me in the right direction on this. My macros that open files run fine on my local terminal, but of course, once I email the application to someone else, those macros aren't going to work because they're referencing file locations on my machine. What is the best way to deal with this? Is there a way to code the file location in the macro so that it automatically looks for the file in the directory...
0
30262
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is a comprehensive list of all autostart locations for Windows OSes: NOTE : These are some abbreviations used in this list. Please note them carefully: HKCU = HKEY_CURRENT_USER HKLM = HKEY_LOCAL_MACHINE
0
9865
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10609
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10667
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10303
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3140
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.