+ Reply to Thread
Results 1 to 3 of 3

compile error... ADODB connection

  1. #1
    ina
    Guest

    compile error... ADODB connection

    Hello all,

    I have a problem with the ADODB connection... and I do not understand
    because yesteday worked fine and today not.

    I have this mistake ...

    compile error, User-defined type not defined

    This is my code

    Sub test()

    '---------------------------------------
    'Connection to sql server
    '---------------------------------------
    'Set up a connection
    Set Cnx = New ADODB.Connection

    Dim cmd As ADODB.Command ...

    Thanks,

    ina


  2. #2
    Jim Thomlinson
    Guest

    RE: compile error... ADODB connection

    As a guess you have not got a reference to the ADODB library. Look in Tools
    -> References for an item marked as missing "Missing: Microsoft ActiveX Data
    Objects..." Uncheck this item and find a version of that library that you do
    have.

    As an aside, you should declare your connection object with a dim statement
    something like this...

    Sub test()
    Dim Cnx as ADODB.Connection
    '---------------------------------------
    'Connection to sql server
    '---------------------------------------
    'Set up a connection
    Set Cnx = New ADODB.Connection

    Dim cmd As ADODB.Command ...

    --
    HTH...

    Jim Thomlinson


    "ina" wrote:

    > Hello all,
    >
    > I have a problem with the ADODB connection... and I do not understand
    > because yesteday worked fine and today not.
    >
    > I have this mistake ...
    >
    > compile error, User-defined type not defined
    >
    > This is my code
    >
    > Sub test()
    >
    > '---------------------------------------
    > 'Connection to sql server
    > '---------------------------------------
    > 'Set up a connection
    > Set Cnx = New ADODB.Connection
    >
    > Dim cmd As ADODB.Command ...
    >
    > Thanks,
    >
    > ina
    >
    >


  3. #3
    ina
    Guest

    Re: compile error... ADODB connection

    Thanks I did it and it works
    Ina


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1