Log in and access to the database very slow

is a week that the login is very slow, even log out and the first printing.
sometimes it happens that sambapos closes unexpectedly.
also access the database from SqlCe40Toolbox software is painfully slow.
I did a test with an empty database and again, but nothing.
could be a problem in SQL Compact?
What proof do I do?

Sounds to me like you have your proof. If access to SQLCE from SQLCE40Toolbox is slow, then it is a DB problem, or limitation in performance for that type of DB Engine, or something else entirely (a computer problem).

In any case, if another program exhibits the same problem when accessing the DB, then it should be safe to assume that it has nothing to do with SambaPOS.

I also tried with the default empty db, but the problem persists!
and in any case the problem came out from 3-4 days and sollo on the login screen!

Are other programs slow?
Does CPU and RAM usage increase dramatically when SambaPOS is running.

Could be Compact SQL, .NET or something else.

Reinstall SambaPOS and tick Local DB during installation.
Run SambaPOS and change your Connection String to SambaPOS4.mdf, restart and test. This will be running the new Local DB which is directly compatible with SQL Express.