ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Temp folder location for ACE/JET ODBC driver for Excel/Access (https://www.excelbanter.com/excel-programming/431810-temp-folder-location-ace-jet-odbc-driver-excel-access.html)

Joe Schluter

Temp folder location for ACE/JET ODBC driver for Excel/Access
 
The ACE/JET drivers expect that there is a Temp folder before it can do any
work. Usually, this is not an issue. However, if the app calling ACE is
running as a Windows Service (using the SYSTEM account) on a 64-bit XP PC
(using WOW, Windows-on-Windows), the required Temp folder may not exist, as
system32\config\systemprofile is redirected to SysWOW64\config\systemprofile.

I need to ascertain where the Temp folder is expected by ACE, so I can
create it if it's not already there. I've used different approaches to find
the Temp folder location (GetTempPath, SHGetFolderPath, SHGetKnownFolderPath,
"Shell Folders" regsitry entry and "Environment" registry entry together with
the USERPROFILE environment variable). Again, these all work fine for regular
users, but when called under SYSTEM, all these methods return different
locations for the Temp folder (and they're not even consistent between XP,
Vista and Windows 7).

So, my question: How does the ACE driver determine the location of the temp
folder? If the folder doesn't exist, any ACE request will result in:

ERROR: CLI error trying to establish connection: [Microsoft][ODBC Microsoft
Access Driver] Your network access was interrupted. To continue, close the
database, and then open it again.

Thanks for any help!


All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com