BookmarkSubscribeRSS Feed
hello_SAS
Calcite | Level 5

I'm using SAS enterprise guide, and need to connect/pull data from a 2007 Microsoft Access Database. The database has custom queries saved as objects in it, and those queries pull from various tables within Access. Overall, there is too much data within the tables to be able to import, so I used a libname statement to connect SAS with Access.

 

LIBNAME (specific to data set) type=access path="folder path to data in server"

SERVER="XXX Server numbers"

PORT=xxx port numbers;

 

This libname statement works great, the library location I have referenced is reading in objects/tables correctly without any issue. EXCEPT:

 

Several of the tables I need to call have a column that is populated using a custom VBA in the Access database. The VBA itself is referencing a couple different attributes within the data and other tables to populate a character in the column; it shows up in the column header when you view the properties of the table. When I try to get these tables, I get the following error:

 

ERROR: CLI describe error: [Microsoft][ODBC Microsoft Access Driver] Undefined function '(column name)' in expression.

 

SAS refuses to pull in any data from those tables because of this custom VBA. What are my options here? Has anyone else run into this issue?

 

1 REPLY 1
hbi
Quartz | Level 8 hbi
Quartz | Level 8

Unfortunately, your custom VBA function is a something that MS Access supports while your database is open in MS Access. The ODBC driver can handle built-in functions (e.g. Now(), Trim(), etc.), but not custom functions.

 

I would suggest running a "make-table" statement in MS Access that calls the VBA function: 

 

SELECT Name, Address, NameOfVBAFunction(name_of_column) AS Expr1
INTO [copy_of_table]
FROM [name_of_table];

This would create a table called "copy_of_table" that contains the results of the function call.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1330 views
  • 0 likes
  • 2 in conversation