Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"