Juglaz
Board Regular
- Joined
- Jul 2, 2013
- Messages
- 177
Hi guys,
I've got a workbook that pulls data from an access database. MS Query created the following connection string which works just fine:
DBQ=C:\Users\t5264ab\Desktop\Dashboard\Claim Analyzer Total 13MY YTD.mdb;DefaultDir=C:\Users\t5264ab\Desktop\misc docs;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;</SPAN>
However I need the paths to be relative and point to a file located in the same folder as the workbook. I used ThisWorkbook.Path:
DBQ=" & ThisWorkbook.Path & "Claim Analyzer Total 13MY YTD.mdb;"DefaultDir=" & ThisWorkbook.Path &;"Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;
After making this change, when Excel goes to refresh the data it gives me a pop-up to Select Data Source. I don't understand why I suddenly need a DSN with a relative reference. Can somebody please help? Thanks.
</SPAN>
I've got a workbook that pulls data from an access database. MS Query created the following connection string which works just fine:
DBQ=C:\Users\t5264ab\Desktop\Dashboard\Claim Analyzer Total 13MY YTD.mdb;DefaultDir=C:\Users\t5264ab\Desktop\misc docs;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;</SPAN>
However I need the paths to be relative and point to a file located in the same folder as the workbook. I used ThisWorkbook.Path:
DBQ=" & ThisWorkbook.Path & "Claim Analyzer Total 13MY YTD.mdb;"DefaultDir=" & ThisWorkbook.Path &;"Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;
After making this change, when Excel goes to refresh the data it gives me a pop-up to Select Data Source. I don't understand why I suddenly need a DSN with a relative reference. Can somebody please help? Thanks.
</SPAN>