Results 1 to 4 of 4
  1. #1
    userThree is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    3

    Question Unable to Read from COM ports in Access 2003

    Hey guys,

    I originally made a program for a client. A standalone program made using the Access 2003 developers extension add in. This worked perfectly on Windows XP. The program was designed to monitor and read inputs from a machine which was connected to the computer (by a transducer and then a serial port which was finally connected to the comp by USB),and draw a graph in access which would later show info to the user in the form of reports, etc.

    Once they upgraded to Windows 7 along came an error. The serial port would not be recognized in access. I figured that the device drivers needed to be upgraded. This was a success except for within the Access program. While device manager would recognize that the com port was in use for the transducer, and that it could also be read from (using the device's testing software), when using access we still got an error saying that the port was unrecognized.



    How do we get Windows 7 to read these ports in Access 2003 which Windows XP so did so easily before?

    Thanks.

    U3

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    check the references of your code to make sure that com objects are enabled:

    http://support.microsoft.com/kb/823179

    I don't know what device you're using but this may be a useful reference too

    http://www.sevenforums.com/network-s...ual-ports.html

  3. #3
    userThree is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    3
    Thank you rpeare.

    For the code I believe that the com objects are enabled appropriately just like in the link you sent. Proof might be because it works in XP. Here is a sample of the code.

    ********************************
    Comm232Ocx.CommPort = SerialPort
    If Err Then
    If Comm232Ocx.CommEvent = comPortInvalid Then
    dummy = MsgBox("Invalid port, try another port!", vbOKOnly, "Invalid Port")
    Exit Sub
    ElseIf Comm232Ocx.CommEvent = comPortAlreadyOpen Then
    dummy = MsgBox("Port already in use by another device! ", vbOKOnly, "Port Already Open")
    Exit Sub
    End If
    End If

    Comm232Ocx.Settings = "9600,N,8,1"

    On Error Resume Next
    Comm232Ocx.PortOpen = True
    If Err Then
    dummy = MsgBox("Invalid port selection!", vbOKOnly, "Invalid Port")
    Exit Sub
    End If

    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''
    Comm232Ocx.InBufferCount = 0 'clear out rs232 input buffer
    'send out first command for data aquisition
    If AdcCal = True Then
    Tx = "!0RA" + Chr(11) 'read channel 12 for ref -ve
    Else: Tx = "!0RA" + Chr(0) 'else read channel 0
    End If
    Comm232Ocx.Output = Tx

    ******************************
    ............etc


    The devices I am using are B&B's serial adapter RS232 (http://www.bb-elec.com/rs232.asp) and their USB converter 232USB9M.

    One thing I forgot to add.

    The references I am using in the program are are Mscomm32.ocx and mfc42.dll and dao360.dll. I am wondering if the problem lies here...

    Windows XP was 32 bit. This windows 7 is 64 bit. Would anyone happen to know of any additional files to register in order for this to work correctly?

    Once again device manager knows the COM port is for the B&B hardware. Works outside of access (with the test software), only has problems in this windows 7 64 bit access...

    Thanks in advance guys.

  4. #4
    userThree is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    3
    I have isolated the problem to these lines.

    ********************************
    Comm232Ocx.CommPort = SerialPort
    If Err Then
    If Comm232Ocx.CommEvent = comPortInvalid Then
    dummy = MsgBox("Invalid port, try another port!", vbOKOnly, "Invalid Port")
    Exit Sub
    ********************************

    While debugging, for Comm232Ocx.commPort and Comm232Ocx.CommEvent, the watch window says "Object doesn't support this property or method" even after setting them.

    But under Comm232Ocx.class it is "MSCOMMLib.MsComm.1" So this should be recognized as a MsComm control...

    How do I get CommEvent and CommPort to be recognized? Please help me out!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-17-2010, 10:38 AM
  2. Access 97: Unable to find project explorer?
    By captgnvr in forum Programming
    Replies: 0
    Last Post: 07-19-2010, 09:20 AM
  3. Read only Access Database
    By Rameez in forum Access
    Replies: 7
    Last Post: 06-23-2009, 12:30 AM
  4. Replies: 2
    Last Post: 10-19-2006, 04:37 PM
  5. Replies: 1
    Last Post: 09-06-2006, 11:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums