LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 13 Feb 2006 05:49:07 -0700
Reply-To:   Alan Churchill <SASL001@SAVIAN.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Alan Churchill <SASL001@SAVIAN.NET>
Subject:   Re: Can SAS invoke Access macros?
Comments:   To: ahowell@NETSPACE.NET.AU
In-Reply-To:   <1139785607.43efbf8748ebc@webmail.netspace.net.au>
Content-Type:   text/plain; charset="us-ascii"

Andrew,

I just built an application that uses SAS and Access. The way that I handle it is to use the OleDB client from SAS to read the SAS datasets (this is a free utility) and then have a .NET application run the Access programs for me. This is simple in the C# world:

conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + physicalDatabaseLocation + ";" ;

OleDbDataAdapter da = new OleDbDataAdapter(query,conn) ;

...where query is a string that you pass to Access.

An alternative way is to use OleDB again but from the Access macro side. SAS datasets can be read using OleDB in a similar manner. I do not use this method since it means using VBA which is on its way out.

If you code a c# program then it can be compiled into a *.exe. Then it is a simple matter to invoke it using the X command in SAS and pass it parms:

x "myprogram.exe -r -s -whatever" ;

Alan

Alan Churchill Savian "Bridging SAS and Microsoft Technologies" www.savian.net

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Andrew Howell Sent: Sunday, February 12, 2006 4:07 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Can SAS invoke Access macros?

Customer: - PC SAS v9.1.3 - SAS/Access to ODBC - SAS/Access to PCFF - Does NOT have SAS/Access to OLEDB

I can create & update Access tables ok from SAS, using pass-thru SQL and sql execute procs from within SAS, but I need Access to do a few other things as well - create/delete relationships, modify data types, compact and backup database prior to import, etc.

1. Can such tasks be performed/invoked from SAS? I presume not. 2. If I have set up some macros within the Access database to perform these tasks, is there a way I can invoke the Access macros from my SAS code?

Thanks.

------------------------------------------------------------ This email was sent from Netspace Webmail: http://www.netspace.net.au


Back to: Top of message | Previous page | Main SAS-L page