Lansweeper data, reports and settings are stored in a database. Your database is hosted in either the Microsoft SQL LocalDB, Microsoft SQL Server or (deprecated) Microsoft SQL Compact database server.
Though Lansweeper has a built-in report builder and a built-in tool for running database scripts, you may at some point want to connect to your database using an external tool. To connect to SQL LocalDB and SQL Server databases, Microsoft's SQL Server Management Studio can be used. To connect to a SQL Compact database, SQL Compact Toolbox can be used. This article explains how to view the raw data in your SQL Compact database using SQL Compact Toolbox. If you are unsure which database server you are using, you can verify using the ConfigEditor tool or in the Lansweeper web console.
Using SQL Compact Toolbox is unnecessary if your goal is to run a report or database script.
Reports can be run in the Lansweeper web console under Reports > Create New Report.
Scripts can be run in the following tool on your Lansweeper server: Program Files (x86)\Lansweeper\Tools\DatabaseMaintenance.exe
.
Please note that you should only run scripts if requested by the Lansweeper support team
- Download SQL Compact 4.0 SP1 through this download link and install it on your Lansweeper server.
Don't skip this step. SQL Compact must be installed as a separate software on your Lansweeper server to connect to your database with the SQL Compact Toolbox later on.
- Download the Standalone 4.0 daily build of SQL Compact Toolbox through this download link and unzip the file.
SQL Compact Toolbox is a third-party tool. The Lansweeper support team cannot troubleshoot potential issues with this tool.
- Run the Toolbox executable as an administrator on your Lansweeper server.
![connecting-to-a-sql-compact-database-with-sql-compact-toolbox-1.jpg connecting-to-a-sql-compact-database-with-sql-compact-toolbox-1.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/886i3A720FDE99AA62ED/image-size/large?v=v2&px=999)
- Right-click No SQL Server Compact Data Connections found and choose Add SQL Server Compact 4.0 Connection... in the menu.
![connecting-to-a-sql-compact-database-with-sql-compact-toolbox-2.jpg connecting-to-a-sql-compact-database-with-sql-compact-toolbox-2.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/887iF4A509BCE1C87D8E/image-size/large?v=v2&px=999)
- Select Browse... in the resulting pop-up and select your Lansweeper database file. The default path of the file is
Program Files (x86)\Lansweeper\SQLData\lansweeperdb.sdf
.![connecting-to-a-sql-compact-database-with-sql-compact-toolbox-3.jpg connecting-to-a-sql-compact-database-with-sql-compact-toolbox-3.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/888i02BBB30016A837D9/image-size/large?v=v2&px=999)
- Click the Close button in the pop-up window.
![connecting-to-a-sql-compact-database-with-sql-compact-toolbox-4.jpg connecting-to-a-sql-compact-database-with-sql-compact-toolbox-4.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/889iC85E0A0416B874EC/image-size/large?v=v2&px=999)
- Expand the Lansweeper database so you can view and query database tables.
![connecting-to-a-sql-compact-database-with-sql-compact-toolbox-5.jpg connecting-to-a-sql-compact-database-with-sql-compact-toolbox-5.jpg](https://community.lansweeper.com/t5/image/serverpage/image-id/890i189AE4EB5FBFE353/image-size/large?v=v2&px=999)
Was this post helpful? Select Yes or No below!
Did you have a similar issue and a different solution? Or did you not find the information you needed? Create a post in our Community Forum for your fellow IT Heroes!
More questions? Browse our Quick Tech Solutions.