linnyphang
asked on
error '438' Object doesn't support this property or method when deploy access applicatioon on client machine
Hi,
I have developed an access application. This application consists of form, queries, table, modules (VBA).
The access application run well in my machine (windows XP profesional). However when I deploy this access application to client machine (windows 2000 profesional), i found this error when user try to click on the 'browse' button.
"error '438' Object doesn't support this property or method"
This is the code for the browse event:
Private Sub cmdBrowse_Click()
Dim strNewFile As String
On Error GoTo Browse_Err
With Me.cdlgOpen
InitDir = "C:\MyDocuments\"
.CancelError = True
.Filter = "Excel Files (*.xls)|*.xls|" 'Can change (i.e. "Word Files (*.doc)|*.doc|") or ("All Files (*.*)|*.*|") see help for other examples
.ShowOpen ' Can use showSave for saving file, same principle
strNewFile = .Filename
txtFilePath.value = strNewFile
End With
Browse_Exit:
Exit Sub
Browse_Err:
If Err.Number = 32755 Then
Resume Browse_Exit
Else
MsgBox Err.Number & ": " & Err.Description
Resume Browse_Exit
End If
End Sub
How can I solve this problem? thanks!
I have developed an access application. This application consists of form, queries, table, modules (VBA).
The access application run well in my machine (windows XP profesional). However when I deploy this access application to client machine (windows 2000 profesional), i found this error when user try to click on the 'browse' button.
"error '438' Object doesn't support this property or method"
This is the code for the browse event:
Private Sub cmdBrowse_Click()
Dim strNewFile As String
On Error GoTo Browse_Err
With Me.cdlgOpen
InitDir = "C:\MyDocuments\"
.CancelError = True
.Filter = "Excel Files (*.xls)|*.xls|" 'Can change (i.e. "Word Files (*.doc)|*.doc|") or ("All Files (*.*)|*.*|") see help for other examples
.ShowOpen ' Can use showSave for saving file, same principle
strNewFile = .Filename
txtFilePath.value = strNewFile
End With
Browse_Exit:
Exit Sub
Browse_Err:
If Err.Number = 32755 Then
Resume Browse_Exit
Else
MsgBox Err.Number & ": " & Err.Description
Resume Browse_Exit
End If
End Sub
How can I solve this problem? thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
using the straight api code for the file dialog box avoids the dll nonsense you are experiencing...
http://www.mvps.org/access/api/api0001.htm
Steve
http://www.mvps.org/access/api/api0001.htm
Steve
ASKER
I deploy the application again by include COMDLG32.OCX in my deployment package.
I install this package on client machine. It works!
However, it wont works if i manually copy this COMDLG32.OCX directly to clinet machine (c:\winnt\system32\)
Thanks a lot for you comments!
I install this package on client machine. It works!
However, it wont works if i manually copy this COMDLG32.OCX directly to clinet machine (c:\winnt\system32\)
Thanks a lot for you comments!
It's good to have a solution but just be wary about deploying DLL's as unfortunately they are 'common' libraries that other applications use and if you copy on one vesion when all the applications are expecting another version, all hell breaks lose!
As far as copying the files on, you usually also need to register them using REGSVR32
As far as copying the files on, you usually also need to register them using REGSVR32
"It's good to have a solution but just be wary about deploying DLL's as unfortunately they are 'common' libraries" ...
that is why I always use the api code instead of the control, I never have to worry about it.
that is why I always use the api code instead of the control, I never have to worry about it.
The API code references COMDLG32.DLL instead of COMDLG32.OCX, so there isn't that much difference.
the difference is that I do not have to worry about presence or installation of the .ocx :-)
True, but what I mean is, OCX or DLL, it doesn't matter, they are both common libraries. If you can get a version problem on the OCX (as in this case), you can get a version problem on the DLL. :-). We won't know in this case unless bossjohnc wants to try your code. I would be interested to find out.
Certainly as far as Access goes, using API's are far more reliable than ticking things in the References or Components list. In fact it might be a good habit for me to start using if it stops that annoying 'Reference not found' problem.
Certainly as far as Access goes, using API's are far more reliable than ticking things in the References or Components list. In fact it might be a good habit for me to start using if it stops that annoying 'Reference not found' problem.
No, not me! I'm not the original author - however from my understanding, if you use the API (DLL), it doesn't matter what version it is, as Windows deals with it rather than Access. For example, with the file dialogue API, depending on the version, the dialogue may look different (depending on the version), but the result passed back to Access won't differ.
I have a fairly basic understanding so I might be wrong of course : )
I have a fairly basic understanding so I might be wrong of course : )
You can download MDACs here...
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/dataaccess.asp
You can use componentchecker to identify incompatible MDAC files and the current version of the MDAC - it's available here...
http://support.microsoft.com/default.aspx?kbid=307255
where there is lots of other useful info on the subject.
This might not be your problem, but I suspect it may be.