VBA into Maximiser

G

Guest

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
 
O

onedaywhen

Daniel said:
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.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ODBC Connection 4
Excel ODBCDIRECT 1
Connection problem using DAO 3
insert data ODBC 3
Excel 16 bit limitation 2
ADO vs DAO in Access 2007 8
Excel Problem 7
When trying to create Workspace, get error 3847 2

Top