Group:  Microsoft Excel ยป microsoft.public.excel.querydao
Thread: JET Connection to SAS

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

JET Connection to SAS
Neil 19.12.2005 11:04:02
Hi All,

I'm trying to open a JET connection to SAS (a statistical analysis package)
from Excel VBA using the code below.

****************************************************
Dim wspSAS_Workspace As Workspace
Dim dbSAS_Database As Database
Dim rcdSAS_Recordset As Recordset

Set wspSAS_Workspace = CreateWorkspace("NewJETWorkspace", "admin", "",
dbUseJet)

Set dbSAS_Database = _
wspSAS_Workspace.OpenDatabase("", dbDriverNoPrompt, ,
"ODBC;DSN=SASODBCConnection;")

*****************************************************

This works, but pops up a dialog box where I can choose the 'Machine Data
Source' tab and my SAS connection. What I can't make it do is just select the
SAS connection without asking.

Any ideas from anybody? This is driving me up the wall.

Thanks,

Neil.
RE: JET Connection to SAS
Neil 19.12.2005 12:44:03
Not to worry. A (long) Google trawl has sorted this one out.

For anyone who comes across the same thing you need to change the
opendatabase line to

Set dbSAS_Database = _
wspSAS_Workspace.OpenDatabase("SASodbcConnection", False, True, "ODBC;")

Merry Christmas!

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net