VBA into Maximiser

D

Daniel Opland

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
 

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

Top