BookmarkSubscribeRSS Feed
Ryanb2
Quartz | Level 8

I created an Access database so users can look up records by ID from a table generated in SAS then exported to Access each morning.  However, I anticipate many users will have the tool open continuously.  When I export a data file and the form accessing the table or query is open I get an error message in SAS reading, "ERROR: Execute: The database engine could not lock table 'EAB_status_2018' because it is already in use by another person or process."  What is the best way to update the table in Access and still allow users to have the query form open?

 

 

PROC EXPORT DATA=TABLE_OF_RECORDS
OUTTABLE='TABLE_IN_ACCESS'
DBMS=ACCESS REPLACE;
DATABASE='C:\TEST\NAME_OF_ACCESS_DB.accdb';
RUN;

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

You are not doing an update here, you are replacing the table. This requires the whole table to be unlocked.

If the table is locked, you can try to update records.

Access seems to have this capability, though I am unsure how it looks from the SAS side.

Ryanb2
Quartz | Level 8

Thanks for the clarification, Chris.  Yes.  This is a full replacement of the table.  I'll look into updating the records rather than the full replacement, although I'd rather find a solution that includes the full replacement. 

 

This database is for reference only.  Users will not be adding, removing, or modifying records.  I noticed the problem remains even when I link to another Access database that is read-only.  Has anyone ever tried linking an Access database to another type of file (e.g., .csv, database file...) that would allow a full replacement?  I tried the csv method but the table is very large and the interface became very sluggish.

ChrisNZ
Tourmaline | Level 20
Full replacement always requires that the table is closed afaik. Read-only is not enough.
Maybe what you could do is that the users access a different table at odd and even hours? It might not help if a user just leaves the screen open though.
SASKiwi
PROC Star

MS Access isn't really designed for simultaneous multi-user use. A better option would be a multi-user database like SQL Server. If you have SAS/ACCESS to ODBC or the SAS/ACCESS product for your chosen database licensed then you are good to go. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 798 views
  • 0 likes
  • 3 in conversation