473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

fHandleFile() Function in Terminal Server

Is anyone using the fHandleFile() from "The Access Web" site in a Terminal
Server environment? I just discovered today that it doesn't work for me.
Even though I can double-click a PDF file and Acrobat is automatically
launched, the function is returning the "File Not Found" error from my app.

I was using this instead of FollowHyperlink because I don't like the way
that the Access app is minimized when using that.

TIA
Nov 12 '05 #1
2 3155
Can you elaborate on that a bit? Did you have to modify the fHandleFile()
function?
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:7p********************************@4ax.com...

Works for me... Although as I recall, I had to use the
"GetShortPathName" API call due to spaces in the application's path.
On Mon, 26 Apr 2004 11:19:52 -0500, "Rick Brandt"
<ri*********@hotmail.com> wrote:
Is anyone using the fHandleFile() from "The Access Web" site in a TerminalServer environment? I just discovered today that it doesn't work for me.Even though I can double-click a PDF file and Acrobat is automatically
launched, the function is returning the "File Not Found" error from my app.I was using this instead of FollowHyperlink because I don't like the way
that the Access app is minimized when using that.

Nov 12 '05 #2
Thanks; a preliminary test seems to indicate that this will solve the
problem.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:ll********************************@4ax.com...

Opps. Sorry... My bad.. The version I have of fHandleFile is a bit
different then what's posted at the Access Web. I've no idea why...

The code I have uses the FindExecutable API call to determine which
program to use, then Shells that:

Private Const MAX_PATH = 260
Private Const ERROR_NOASSOC = 31
Private Const ERROR_FILE_NOT_FOUND = 2&
Private Const ERROR_PATH_NOT_FOUND = 3&
Private Const ERROR_BAD_FORMAT = 11&
Private Const ERROR_OUT_OF_MEM = 0

Private Declare Function FindExecutable _
Lib "shell32.dll" _
Alias "FindExecutableA" _
(ByVal lpFile As String, _
ByVal lpDirectory As String, _
ByVal lpResult As String) _
As Long

Private Declare Function GetShortPathName _
Lib "kernel32" _
Alias "GetShortPathNameA" _
(ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long) _
As Long

Private Function FindEXE(strFile As String, _
strDir As String) _
As String

Dim lpResult As String
Dim lngRet As Long
lpResult = Space$(MAX_PATH)
lngRet = FindExecutable(strFile, strDir, lpResult)

If lngRet > 32 Then
FindEXE = lpResult
If InStr(FindEXE, Chr$(0)) > 0 Then
FindEXE = Left$(FindEXE, InStr(FindEXE, Chr$(0)) - 1)
End If
Else
Select Case lngRet:
Case ERROR_NOASSOC
FindEXE = "Error: No Association"
Case ERROR_FILE_NOT_FOUND
FindEXE = "Error: File Not Found"
Case ERROR_PATH_NOT_FOUND
FindEXE = "Error: Path Not Found"
Case ERROR_BAD_FORMAT
FindEXE = "Error: Bad File Format"
Case ERROR_OUT_OF_MEM
FindEXE = "Error: Out of Memory"
End Select
End If
End Function

Private Function GetShortName(ByVal strFileName As String) As String
Dim strShortPath As String
Dim lngBuffer As Long, lngRet As Long
strShortPath = String$(MAX_PATH, 0)
lngBuffer = Len(strShortPath)
lngRet = GetShortPathName(strFileName, strShortPath, lngBuffer)
GetShortName = Left(strShortPath, lngRet)
End Function
'----------------------------------------------------------------------

Then in the function to "run" the file, I use:

strEXEName = FindEXE(strFileToRunWithoutPath, strPathToFileToRun)
strEXEShort = GetShortName(strEXEName)
lngTaskID = Shell(strEXEShort & " " & strFileToRun, vbMaximizedFocus)

Note that you need to split off the path to the file you want to "run"
to use the above. I'll leave how you want to do that up to you.
<grin>
On Tue, 27 Apr 2004 12:30:52 -0500, "Rick Brandt"
<ri*********@hotmail.com> wrote:
Can you elaborate on that a bit? Did you have to modify the fHandleFile()
function?

"Chuck Grimsby" <c.*******@worldnet.att.net.invalid> wrote in message
news:7p********************************@4ax.com.. .
Works for me... Although as I recall, I had to use the
"GetShortPathName" API call due to spaces in the application's path.

On Mon, 26 Apr 2004 11:19:52 -0500, "Rick Brandt"
<ri*********@hotmail.com> wrote:
>Is anyone using the fHandleFile() from "The Access Web" site in a
>Terminal
>Server environment? I just discovered today that it doesn't work for
>me.
>Even though I can double-click a PDF file and Acrobat is automatically >launched, the function is returning the "File Not Found" error from my >app.
>I was using this instead of FollowHyperlink because I don't like the way >that the Access app is minimized when using that.

Nov 12 '05 #3

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

Similar topics

2
by: Rick Brandt | last post by:
Is anyone using the fHandleFile() from "The Access Web" site in a Terminal Server environment? I just discovered today that it doesn't work for me. Even though I can double-click a PDF file and...
8
by: OHM | last post by:
Hi peoples, I dont know where to place this question, so as I know you guys are all resourceful experts, I thought I would try here. I am writing some code which will be run usingh remote...
6
by: Atley | last post by:
I have a Terminal Services server running Windows 2000 Server. I need to be able to identify, in my application on that server, which client computer is addressing that server and running that...
0
by: Microsoft News | last post by:
Anyone knows how to find out how many instances of Terminal Server is running? If I have a Terminal server that has 5 licenses and 4 user's logon I want to know how to find out that 4 users are...
3
by: shawn | last post by:
In the past I have had SQL and Terminal server on the same PC. With SQL and Windows 2003 Terminal server, you can not have them on the same PC. How can I make this work with SQL and Terminal and...
5
by: cityrock | last post by:
Hello friends. It has come time for me to face a dilema i have been thinking about for a long time, but actually doing nothing. Now its time to act. The situation is "simple", and i have just...
7
by: mike | last post by:
We have numerous Access 97 apps that we run on our Terminal Server, but two apps in particular is giving us a problem. The problem we are running into is when you select a drop down menu, it errors...
10
by: gary0gilbert | last post by:
An unusual spin to this recurring disk or network error in a Terminal Server environment. Access 2000, Terminal Server 2000, file server is windows 2000. All users have a separate copy of the...
1
by: =?Utf-8?B?QW50amU=?= | last post by:
I need product keys for Terminal Server Windows Server 2008 access (CALs) under MSDN - TSLM Service said they cannot provide product keys for the access.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.