+ Reply to Thread
Results 1 to 3 of 3

VBA into Maximiser

  1. #1
    Daniel Opland
    Guest

    VBA into Maximiser

    i've connected successfully into Maximiser using the MS Query tool and the
    ODBC driver for Maximiser. However when pass this file on to another machine,
    the DSN connection is not there and even if i set it up, next time i open the
    file it asks for the DSN settings again.

    So I tried creating a workspace, which i thought would open and maintain a
    connection to Maximizer, thus removing the need to log on each time. I used
    the code below:

    Sub Workbook_Open()

    Dim wrkODBC As Workspace
    Dim conMax As Connection

    ' Create ODBCDirect Workspace object.
    Set wrkODBC = CreateWorkspace("Maximiser", _
    "DANIEL", "", dbUseODBC)


    ' OpenDatabase (i also tried OpenConnection, no go)

    Set conMax = wrkODBC.OpenDatabase("EOH-KZN", dbDriverPrompt, True, _
    "ODBC;DSN=EOH-KZN;UID=DANIEL;DBQ=C:\Documents and Settings\dopland\My
    Documents\My Data Sources;CODEPAGE=1252;")

    End Sub

    I get a type-mismatch error on the "Set conMax = "... line.

    Help.
    thanks
    dan

  2. #2
    onedaywhen
    Guest

    Re: VBA into Maximiser

    Daniel Opland wrote:
    > I get a type-mismatch error on the "Set conMax = "... line.


    Do you have a reference to another type library etc with a Connection
    object e.g. ADO? Try explicitly prefacing your declaration using the
    correct library name e.g.

    Dim conMax As DAO.Connection

    Jamie.

    --


  3. #3
    Daniel Opland
    Guest

    Re: VBA into Maximiser

    Jamie,

    u da man!!

    i guess that makes me the "DUH!!"

    thanks

    "onedaywhen" wrote:

    > Daniel Opland wrote:
    > > I get a type-mismatch error on the "Set conMax = "... line.

    >
    > Do you have a reference to another type library etc with a Connection
    > object e.g. ADO? Try explicitly prefacing your declaration using the
    > correct library name e.g.
    >
    > Dim conMax As DAO.Connection
    >
    > Jamie.
    >
    > --
    >
    >


+ 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