How to Fix Excel Data Could Not Be Retrieved from the Database Error
Question details
The user is encountering an error preventing them from importing or refreshing data from an external database or another Excel workbook.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Importing or refreshing data connections linked to an external Excel workbook.
- Observed behavior
- Excel displays a "Data could not be retrieved from the database" error message and fails to update or import the external data.
Ensure you have read access to the network drive or local folder where the source workbook is stored, and confirm that the source file hasn't been accidentally deleted or renamed.
Verify and Reconnect the Data Source
Checking the source file path and refreshing the data source settings is the most effective way to restore the connection to the external workbook.
This error frequently occurs when the linked source file is moved, renamed, or temporarily locked by another process. By updating the connection properties in Excel, you can quickly re-establish the link.
Navigate to the folder where your source Excel workbook is saved to verify the file name and path are correct, and ensure the file is not currently open in another application.
Open the Excel workbook experiencing the error, go to the 'Data' tab on the ribbon, and click on 'Queries & Connections'.
Right-click the problematic connection in the side panel, select 'Properties', navigate to the 'Definition' tab, and update the connection string to ensure it points to the correct file path.
Click 'Refresh All' under the Data tab to test if the connection to the database or external workbook has been restored successfully.

Seamlessly Import and Manage External Data with WPS Office
WPS Spreadsheets offers a robust, free, and lightweight solution for managing external data imports and connections. Experience a familiar interface and flawless compatibility with Microsoft Excel files without the hassle of connection errors.
- 1. Open WPS Spreadsheets: Launch WPS Office and open a new or existing spreadsheet.
- 2. Navigate to the Data Tab: Click on the 'Data' tab located at the top ribbon menu to access data management tools.
- 3. Import External Data: Select 'Import Data' to securely connect to external workbooks or databases without complicated configurations.
- 4. Manage Connections: Use the 'Edit Links' feature under the Data tab to easily update file paths and refresh your linked sources.

Frequently Asked Questions
Why does Excel say data could not be retrieved from the database?
This usually happens if the source file has been moved, renamed, deleted, or is currently locked by another application or user on a shared network.
How do I fix a broken data connection in Excel?
Go to the Data tab, click on Queries & Connections, right-click your broken connection to select Properties, and update the exact file path in the Definition tab.
Can I retrieve data from a workbook stored on a shared network drive?
Yes, but ensure you have the correct network permissions and that the network drive is actively connected and accessible before refreshing the data in Excel.
Will this database error occur if the source file is corrupted?
Yes, trying to pull data from a corrupted file or an unsupported format can trigger data retrieval errors. Always ensure the source is a valid and working Excel workbook.




