MsComm32

Did anyone know the us of mscomm32.ocx in access97.
How do i initalisize this ocx?
Dim oCom1 As ????
Set oCom1 = ????
If have the ocx-file, but there's alos a file called "comm96.hlp", fomerly shipped by Microsoft.
JochenKramerAsked:
Who is Participating?
 
ozphilConnect With a Mentor Commented:
if you insert the ocx, you can use it without any vba initialisation.

insert/activex control and select 'microsoft communications control version 5.0'.

give the name of control a sensible name like oCom1 and you can use its properties and methods as you would any other control.
0
 
ozphilCommented:
You can also refer to object without inserting ocx in a form.

To include the mscomm32.ocx library references, make sure you  viwinf any module in desing mode and do tools/references/ and check 'Micorsoft Comm Control 5.0'. if its not in the list, browse for it in c:\windows\system\mscomm.ocx.

MSComm is the name of the comms object class.


You can code like this:
Sub comms()
Dim i As Integer
Dim oCom As New MSComm
i = oCom.CommPort
Set oCom = Nothing
End Sub



0
 
ozphilCommented:
If you desire further elaboration please provide a comment.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
JochenKramerAuthor Commented:
Hi,
thanks for your answer, but i have still problems

i entered the your code and get error
"cannot create object from activex"

mscomm32 is registered by regsvr32
in access it is in the object-catalog and a testprogramm for listing references shows me the name of the library and the version (1.1)
Whats wrong now?
Do i need other files or dlls?

Greetings
Jochen

0
 
ozphilCommented:
You havent quite installed this animal's activeX and references.

I have reproduced your error by removing the activeX/references installation.

I did not register using regsvr32.

For activeX registration please do following via Access 97 module design mode:
tools/activeX controls.../Register/navigate to mscomm32.ocx and OK it. it should now register. You should then see' Microsoft Communications Control, version 5.0' in list.

For References registration please do following via Access 97 module design mode:
tools/references/browse/navigate to mscomm32.ocx and OK it.
You should then see' Microsoft Comm control 5.0' in list. If at beginning you see 'MISSING:Microsoft Comm control 5.0', uncheck it, OK it, and repeat registration.

If you follow the above two procedures the code willl work.

0
 
JochenKramerAuthor Commented:
Sorry, but it did't work.
I made a proc for testing the references like this:

Sub ShowMeAll()
Dim ref As Reference
For Each ref In References
    If ref.IsBroken = False Then
        Debug.Print "Name: ", ref.Name
        Debug.Print "Fullpath: ", ref.FullPath
        Debug.Print "Version: ", ref.Major & "." & ref.Minor
    Else
        Debug.Print "Verweis ist ungültig: ", ref.Guid    
    End If
Next ref        
End Sub
Output (last two)
Name:         Msacal20
Fullpath:     D:\WINPROGS.16\ACCESS20\ADT\MSACAL20.OCX
Version:      1.0
Name:         MSCommLib
Fullpath:     C:\WINNT\system32\mscomm32.ocx
Version:      1.1

i think the ocx is active in access, but i have still the same error message "cannot create object from activex"

What can i do now? Is there a difference between the american  and my german access version?
Thank you for your help
Jochen
0
 
ozphilCommented:
Is the activeX installed also via tools/activeX controls.

the error message can appear if supporting dlls are incorrect.

this type of error is a real pain.

By the way  im running win95.
0
 
JochenKramerAuthor Commented:
It's also installed by tools/activeX Controls
Im running win95 too with same problems.
Which dlls i need too, i think i have only mscomm32.ocx
0
 
ozphilCommented:
who knows.

i found this file mscomm32.dep in system directory, look at contents below and see if you can work out what your country dependency is and whats missing. good luck.

contents of mscomm32.dep:
--------------------------------------------

; Dependency file for setup wizards.

[Version]
Version=5.0.37.14

; Dependencies for MSComm32.ocx

; Default Dependencies ----------------------------------------------

[MSComm32.ocx]
Dest=$(WinSysPath)
Register=$(DLLSelfRegister)
Version=5.0.37.14
Uses1=ComCat.dll
Uses2=
CABFileName=MSComm32.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComm32.inf

[ComCat.dll]
Dest=$(WinSysPathSysFile)
Register=$(DLLSelfRegister)
Uses1=

; Localized Dependencies --------------------------------------------

; ** German (DE) ***
; (0007 = German)
;
[MSComm32.ocx <0007>]
Uses1=MSComDE.dll
Uses2=

[MSComDE.dll <0007>]
Uses1=
CABFileName=MSComDE.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComDE.inf

; ** French (FR) ***
; (000C = French)
;
[MSComm32.ocx <000C>]
Uses1=MSComFR.dll
Uses2=

[MSComFR.dll <000C>]
Uses1=
CABFileName=MSComFR.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComFR.inf

; ** Italian (IT) ***
; (0010 = Italian)
;
[MSComm32.ocx <0010>]
Uses1=MSComIT.dll
Uses2=

[MSComIT.dll <0010>]
Uses1=
CABFileName=MSComIT.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComIT.inf

; ** Spanish (ES) ***
; (000A = Spanish)
;
[MSComm32.ocx <000A>]
Uses1=MSComES.dll
Uses2=

[MSComES.dll <000A>]
Uses1=
CABFileName=MSComES.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComES.inf

; ** Japanese (JP) ***
; (0011 = Japanese)
;
[MSComm32.ocx <0011>]
Uses1=MSComJP.dll
Uses2=

[MSComJP.dll <0011>]
Uses1=
CABFileName=MSComJP.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComJP.inf

; ** Korean (KO) ***
; (0012 = Korean)
;
[MSComm32.ocx <0012>]
Uses1=MSComKO.dll
Uses2=

[MSComKO.dll <0012>]
Uses1=
CABFileName=MSComKO.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComKO.inf

; ** Chinese Traditional (CHT) ***
; (0404 = Chinese Traditional)
;
[MSComm32.ocx <0404>]
Uses1=MSComCHT.dll
Uses2=

[MSComCHT.dll <0404>]
Uses1=
CABFileName=MSComCHT.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComCHT.inf

; ** Chinese Simplified (CHS) ***
; (0804 = Chinese Simplified)
;
[MSComm32.ocx <0804>]
Uses1=MSComCHS.dll
Uses2=

[MSComCHS.dll <0804>]
Uses1=
CABFileName=MSComCHS.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb5
CABINFFile=MSComCHS.inf
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.