473,466 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Create 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\system32
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\system32, 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 5001
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.16608$4N3.4580@newsfe1-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\system32
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\system32, 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.16608$4N3.4580@newsfe1-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\system32
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
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...
9
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...
2
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...
1
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...
0
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...
4
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...
0
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...
4
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...
2
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,...
0
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...
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
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,...
1
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.