Hi All,
I'm having a problem with the Shell32.dll when I try to open a program
from my Access db.
When I try to open a program called FalconViewLite from my access
database I get an error in the FileHandle function. The message is
something like: Shell32.dll missing entry OpenAS_RunDLL!.
On another machine, also running WinXP the problem doesn't occur.
This is the code I use:
Private Declare Function apiShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long
Function fHandleFile(strFile As String, IShowHow As Long)
Dim IRet As Long, varTaskID As Variant
Dim stRet As String
'First try to shell execute
IRet = apiShellExecute(hWndAccessApp, vbNullString, _
strFile, vbNullString, vbNullString, IShowHow)
If IRet ERROR_SUCCESS Then
stRet = vbNullString
IRet = -1
Else
Select Case IRet
Case ERROR_NO_ASSOC:
'Try the OpenWith dialog
varTaskID = Shell("rundll32.exe shell32.dll,
OpenAS_RunDLL " _
& stFile, WIN_NORMAL)
IRet = (varTaskID <0)
Case ERROR_OUT_OF_MEM:
stRet = "Error: Out of memory. Could not execute!"
Case ERROR_FILE_NOT_FOUND:
stRet = "Error: File not found. Could not execute!"
Case ERROR_PATH_NOT_FOUND:
stRet = "Error: Path not found. Could not execute!"
Case ERROR_BAD_FORMAT:
stRet = "Error: Bad format. Could not execute!"
Case Else:
End Select
End If
fHandleFile = IRet & IIf(stRet = "", vbNullString, ", " & stRet)
End Function
Regards
Marco 1 3552
On Feb 21, 12:25 am, Zai...@gmail.com wrote:
Hi All,
I'm having a problem with the Shell32.dll when I try to open a program
from my Access db.
When I try to open a program called FalconViewLite from my access
database I get an error in the FileHandle function. The message is
something like: Shell32.dll missing entry OpenAS_RunDLL!.
On another machine, also running WinXP the problem doesn't occur.
This is the code I use:
Private Declare Function apiShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long
Function fHandleFile(strFile As String, IShowHow As Long)
Dim IRet As Long, varTaskID As Variant
Dim stRet As String
'First try to shell execute
IRet = apiShellExecute(hWndAccessApp, vbNullString, _
strFile, vbNullString, vbNullString, IShowHow)
If IRet ERROR_SUCCESS Then
stRet = vbNullString
IRet = -1
Else
Select Case IRet
Case ERROR_NO_ASSOC:
'Try the OpenWith dialog
varTaskID = Shell("rundll32.exe shell32.dll,
OpenAS_RunDLL " _
& stFile, WIN_NORMAL)
IRet = (varTaskID <0)
Case ERROR_OUT_OF_MEM:
stRet = "Error: Out of memory. Could not execute!"
Case ERROR_FILE_NOT_FOUND:
stRet = "Error: File not found. Could not execute!"
Case ERROR_PATH_NOT_FOUND:
stRet = "Error: Path not found. Could not execute!"
Case ERROR_BAD_FORMAT:
stRet = "Error: Bad format. Could not execute!"
Case Else:
End Select
End If
fHandleFile = IRet & IIf(stRet = "", vbNullString, ", " & stRet)
End Function
Regards
Marco
Typically one opens a program from an Access db with
Shell "FalconViewLite"
or
Shell "C:\Program Files\Path\FalconViewLite", vbNormal
Of course, you may have good reasons for being elaborate. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Randy Jackson |
last post by:
Hello all.
Okay, this seems really stupid, but it's driving me up the wall.
I have a simple script I've written to log some information to a text
file. Everything seems to be okay, the code...
|
by: Lokkju |
last post by:
I am pretty much lost here - I am trying to create a managed c++
wrapper for this dll, so that I can use it from c#/vb.net, however, it
does not conform to any standard style of coding I have seen....
|
by: Just Me |
last post by:
I've referenced the shell32.dll but can't seen to use it.
Could someone give an example of using any function in it?
Something like:
Dim ShellQAs New Shell32.ShellClass
Dim shellFolder...
|
by: Steve Mauldin |
last post by:
I am trying to get from files the keywords saved as part of the properties
under the summary tab. I am able to get the Title, and Comments using the
following code but I need to get the keywords...
|
by: Steve Mauldin |
last post by:
I am trying to get from files the keywords saved as part of the properties
under the summary tab. I am able to get the Title, and Comments using the
following code but I need to get the keywords...
|
by: Ernesto |
last post by:
I'm just want to read in the contents of a (text) file. The text file
is filled with semiColon delimited floating point strings...
0.456;1.265;99.742;...
For some reason, I can't get the...
|
by: SharpCoderMP |
last post by:
hi,
in my app i monitor the filesystem for changes with FileSystemWatchers.
When the change is detected the app performs some actions using Shell32
to obtain information from the filesystem. now...
|
by: CSUIDL PROGRAMMEr |
last post by:
I am new to python. so be patient with me
I am trying to redirect the output of os.popen command to a file. I
want to append to that file. but instead of appending. The file only
shows last...
|
by: Eran.Yasso |
last post by:
Hi all,
The following code sets/disables network adpter's status. Since I have
no idea where to put this code and I wish to share the community with
it. I did rverse engineering from VBS to C#....
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |