?
Solved

Compile Error Open Connection

Posted on 2012-08-10
6
Medium Priority
?
328 Views
Last Modified: 2012-08-13
I am getting a compile error on this line.   " Dim cn As ABC.IOConnection"
"User defined type not defined"

I am thinking it is the references, but the Reference icon is not enabled when I try to open from this module.

When I look at the References from the form VBA they look like they have have all the References I need



Private Sub cmdIODialog_Click()
   Dim cn As ABC.IOConnection
    Set cn = New ABC.IOConnection
    cn.SettingsUI
0
Comment
Question by:leezac
  • 4
  • 2
6 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38281793
Define for us in great detail what ABC is.  By any chance do you mean ADO or ADODB?

If you click on ABC and do a right-click:Definition and get a message box that says 'Identifier under cursor is not recognized', then Access doesn't know either.
0
 

Author Comment

by:leezac
ID: 38281956
ABC is a third party application where I am connecting to  to retrieve records into database using ADODB.  The code above is checking connection.
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38281973
>When I look at the References from the form VBA they look like they have have all the References I need
Okay, in that case...
(1)  Just for kicks and giggles, make sure again that the Tools:References dialog has a line for whatever ABC is, and that it is checked.
(2)  If the ABC .dll (.whatever) is on your local box, everything that ABC may reference also needs to be installed on your box.   If memory serves there is a Microsoft Dependancy Walker application that you can open, point to any .dll, and verify that everything that THAT .dll has as dependancies are all good.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:leezac
ID: 38282115
Jim - it is not a dll.  I am not sure what it is as I inherited this code and am learning.  

Here is how it is used elsewhere

Public Sub Check_Connection()

    On Error GoTo Err_Check_Connection
    Set cn = CreateObject("ABC.IOConnection")
    cn.CommType = "IP"
    cn.HostIP = "00.00.000.00"
    cn.Port = "0000"

    If IsNull(Forms!frmMain.txtIP) Or IsNull(Forms!frmMain.txtPort) Or IsNull(Forms!frmMain.txtUser) Or _
        (Forms!frmMain.txtIP <> cn.HostIP Or Forms!frmMain.txtPort <> cn.Port Or Forms!frmMain.txtUser <> cn.UserId) Then
        Dim d As Object
        Set d = CreateObject("ABC.IOConnection")
        d.SettingsUI
        If d.GetOk <> True Then
            Set d = Nothing
            Exit Sub
        End If
        Set d = Nothing
    End If
   
    With Forms!frmMain
        .txtCommType = cn.CommType
        .txtIP = cn.HostIP
        .txtPort = cn.Port
        .txtUser = cn.UserId
        .txtPassword = cn.Password
    End With
   
    Set cn = Nothing
    Set cn = CreateObject("ABC.IOConnection")
    cn.CommType = "IP"
    Exit Sub
   
Err_Check_Connection:
MsgBox Err.Description
0
 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 total points
ID: 38282134
>Jim - it is not a dll.  I am not sure what it is
Curiosity overwhelms me ...  Take a screen shot of your Tools:References dialog, and paste it as an image into this question.
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38289362
Thanks for the grade, but did we get an answer?
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question