[AccessD] Importing excel 2007 data with a query

Doug Murphy dw-murphy at cox.net
Wed Aug 19 16:05:12 CDT 2009


Folks,

I have to bring information into a database from excel files. The idea is to
let the user put the file into a directory, hit a button in the datatabase
and a query runs that will inport predefined cells into a temp table. The
Excel file and temp table have given structures. I have done this before in
Access 2002 with no problem. Now we are in 2007 and it does not work.  Here
is the sample query text:

SELECT * FROM [Excel 12.0 Xml;HDR=YES;IMEX=2;ACCDB=YES;DATABASE=C:\Documents
and Settings\Doug\My Documents\CCARTA\;].[SC.xlsx] AS T;

When this query is run I get the error "the microsoft access database engine
cannot open or write to the file .... It is already opened exclusively by
another user or you need permission to view and write the its data."

Any idea where the problem is? I can link to the excel file and that may be
the easiest way to do this. I was trying to make this whole process dynamic.

Thanks

Doug




More information about the AccessD mailing list